Skip to content

Commit b00ef59

Browse files
Copilotlaeubi
authored andcommitted
Fix intermittent JUnit5 test failure by adding timeout to session result poll
1 parent 7812c56 commit b00ef59

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ui/org.eclipse.pde.junit.runtime.tests/src/org/eclipse/pde/junit/runtime/tests/TestExecutionUtil.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,14 @@ public void sessionFinished(ITestRunSession session) {
7979

8080
try {
8181
launchAndWaitForTermination(launchConfiguration);
82-
ITestRunSession result = testResult.poll();
82+
ITestRunSession result = testResult.poll(30, TimeUnit.SECONDS);
8383
if (result == null) {
8484
fail("test was not executed");
8585
}
8686
return result;
87+
} catch (InterruptedException e) {
88+
Thread.currentThread().interrupt();
89+
throw new RuntimeException("test interrupted", e);
8790
} finally {
8891
JUnitCore.removeTestRunListener(testRunListener);
8992
}

0 commit comments

Comments
 (0)