Skip to content

Commit 6e554c7

Browse files
committed
Try to throw an exception with the end of the log file if the coref benchmark test doesn't work as expected
1 parent 243a8df commit 6e554c7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

itest/src/edu/stanford/nlp/dcoref/DcorefBenchmarkSlowITest.java

+9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import java.io.File;
77
import java.io.IOException;
88
import java.io.StringReader;
9+
import java.util.List;
910
import java.util.Properties;
1011
import java.util.regex.Matcher;
1112
import java.util.regex.Pattern;
@@ -130,6 +131,14 @@ public static Counter<String> getCorefResults(String resultsString) throws IOExc
130131
}
131132
}
132133

134+
if (results.keySet().isEmpty()) {
135+
List<String> lines = StringUtils.split(resultsString, "\\R");
136+
int start = Math.max(0, lines.size() - 20);
137+
lines = lines.subList(start, lines.size() - start);
138+
String tail = StringUtils.join(lines, "\n");
139+
throw new RuntimeException("Coref output did not have any results in it! The end of the log is as follows:\n" + tail);
140+
}
141+
133142
return results;
134143
}
135144

0 commit comments

Comments
 (0)