Skip to content

Commit

Permalink
run on later jdk
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Jan 22, 2025
1 parent feba503 commit 5d2c9c0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/test/java/org/htmlunit/javascript/JavaScriptEngineTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ public void shutdownShouldKill() throws Exception {
try (WebClient webClient = getWebClient()) {
// there is no way to kill a thread in later JDK's
// to make the test running we need a final timeout for js stuff
webClient.setJavaScriptTimeout(DEFAULT_WAIT_TIME * 20);
webClient.setJavaScriptTimeout(DEFAULT_WAIT_TIME * 10);

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

}
Thread.sleep(400);
assertTrue(getJavaScriptThreads().isEmpty());
try {
assertTrue(getJavaScriptThreads().isEmpty());
}
catch (final AssertionError e) {
Thread.sleep(DEFAULT_WAIT_TIME * 10);
assertTrue(getJavaScriptThreads().isEmpty());
}
}

/**
Expand Down

0 comments on commit 5d2c9c0

Please sign in to comment.