SeleniumHQ / SeleniumHQ/htmlunit-driver

Runasync causing deadlock?

Open
#146 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
266
Forks
91
PR merge metrics
No merged PRs in 30d

Description

https://github.com/SeleniumHQ/htmlunit-driver/blob/3fc6ca6b4eca6c45e393a41ca9785842b0816ed4/src/main/java/org/openqa/selenium/htmlunit/HtmlUnitDriver.java#L352

When running the driver, I was able to deadlock it by calling driver.get(url) while the runAsyncRunning_ was already set to true.

The driver ended up in an endless loop and whatever originally set the field to true never finished (or was interrupted).

I'm wondering what the reason is to wait for async when calling driver.get, as ideally I would expect the driver to drop everything it was doing (and ignore any background javascript or other async tasks) and immediately open the new page.

Or is this standard behavior on other browsers as well where opening a new url in the same window is delayed until background tasks finish?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/main/java/org/openqa/selenium/htmlunit/HtmlUnitDriver.java around line 352 and reproduce driver.get(url) while runAsyncRunning_ is true. Trace why navigation waits indefinitely, clarify the expected browser behavior, and verify that the selected behavior no longer leaves driver.get in an endless loop.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing-qa
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.