Skip to content

Commit 5d2c9c0

Browse files
committed
run on later jdk
1 parent feba503 commit 5d2c9c0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/test/java/org/htmlunit/javascript/JavaScriptEngineTest.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@ public void shutdownShouldKill() throws Exception {
11841184
try (WebClient webClient = getWebClient()) {
11851185
// there is no way to kill a thread in later JDK's
11861186
// to make the test running we need a final timeout for js stuff
1187-
webClient.setJavaScriptTimeout(DEFAULT_WAIT_TIME * 20);
1187+
webClient.setJavaScriptTimeout(DEFAULT_WAIT_TIME * 10);
11881188

11891189
final List<String> collectedAlerts = new ArrayList<>();
11901190
webClient.setAlertHandler(new CollectingAlertHandler(collectedAlerts));
@@ -1195,7 +1195,13 @@ public void shutdownShouldKill() throws Exception {
11951195

11961196
}
11971197
Thread.sleep(400);
1198-
assertTrue(getJavaScriptThreads().isEmpty());
1198+
try {
1199+
assertTrue(getJavaScriptThreads().isEmpty());
1200+
}
1201+
catch (final AssertionError e) {
1202+
Thread.sleep(DEFAULT_WAIT_TIME * 10);
1203+
assertTrue(getJavaScriptThreads().isEmpty());
1204+
}
11991205
}
12001206

12011207
/**

0 commit comments

Comments
 (0)