Skip to content

Testexecution Thread stopped endless #390

Description

@Deadc00l

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();

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions