While test execution of different scenarios the test execution hangs in:
Unsafe.park(boolean, long) line: not available [native method]
LockSupport.park(Object) line: 175
CountDownLatch$Sync(AbstractQueuedSynchronizer).parkAndCheckInterrupt() line
This happens for different actions on Html pages
- webWindow.getWebClient().getPage(pUrl)
- htmlElement.click();
If the action runs into the following method and js script is enabled, the thread is parked forever
HtmlPage.executeEventHandlersIfNeeded(String)
An analysis shows that this behavior shows up since commit c23eaf8 ("use our own executorService") from 11. Apr 2020
The number of Websockets threads for our testapplication is often greater than 10. The fixed size of the added threadpool leads to an endless wait.
Supposed fix: switch to a cached ThreadPool.
Replace in com.gargoylesoftware.htmlunit.WebClient.getExecutor() fix value of "10" into:
final ThreadPoolExecutor tmpThreadPool = (ThreadPoolExecutor) Executors.newCachedThreadPool();
While test execution of different scenarios the test execution hangs in:
This happens for different actions on Html pages
If the action runs into the following method and js script is enabled, the thread is parked forever
An analysis shows that this behavior shows up since commit c23eaf8 ("use our own executorService") from 11. Apr 2020
The number of Websockets threads for our testapplication is often greater than 10. The fixed size of the added threadpool leads to an endless wait.
Supposed fix: switch to a cached ThreadPool.
Replace in com.gargoylesoftware.htmlunit.WebClient.getExecutor() fix value of "10" into:
final ThreadPoolExecutor tmpThreadPool = (ThreadPoolExecutor) Executors.newCachedThreadPool();