Skip to content

Commit 1e9899c

Browse files
committed
Wait longer for thread stop on timeout. Report now robust to unevaluated test results.
1 parent 52e6dc0 commit 1e9899c

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

BevoTest/src/edu/utexas/cs/bevotest/BevoTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,9 @@ public Void run() {
386386
*/
387387
testThreadGroup.stop();
388388
}
389-
if (hasActiveUserThreads(testThreadGroup)) {
390-
/* Give the stop a little time to propagate */
389+
/* Give the stop time to propagate */
390+
final long maxWait2 = System.currentTimeMillis() + 500L;
391+
while (hasActiveUserThreads(testThreadGroup) && System.currentTimeMillis() < maxWait2) {
391392
Thread.sleep(10L);
392393
}
393394
if (!testThreadGroup.isDestroyed()) {

BevoTest/src/edu/utexas/cs/bevotest/PlaintextTestReporter.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,15 @@ public int[] get(final Object key) {
167167
testedClasses.put(tic, describeClass(result.getTestItemClass(), true));
168168
}
169169
final int[] evals = testedClassEvals.get(tic);
170-
evals[result.getEvaluation().ordinal()]++;
170+
if (result.getEvaluation() != null) {
171+
evals[result.getEvaluation().ordinal()]++;
172+
}
173+
}
174+
if (result.getEvaluation() != null) {
175+
overallEvals[result.getEvaluation().ordinal()]++;
176+
} else {
177+
System.err.println("BevoTest: WARNING: Test result without evaluation not counted. Test case description: "+result.getTestCase().getDescription());
171178
}
172-
overallEvals[result.getEvaluation().ordinal()]++;
173179
}
174180
}
175181
out.append("TEST SUMMARY").append(newLine);
@@ -320,7 +326,7 @@ public void reportEntry(final TestExecutionResult<?, ?> entry, final Appendable
320326
if (entry.getStatus() == Status.COMPLETE_NORMAL) {
321327
out.append(" Test procedure run time: ").append(String.valueOf(entry.getRunTime())).append(" ms").append(newLine);
322328
}
323-
out.append(" Evaluation: ").append(entry.getEvaluation().toString()).append(newLine);
329+
out.append(" Evaluation: ").append(entry.getEvaluation()!=null?entry.getEvaluation().toString():"[unevaluated]").append(newLine);
324330
}
325331
}
326332

0 commit comments

Comments
 (0)