Skip to content

fix: avoid race condition when opening side channel#47

Merged
paodb merged 1 commit into
mainfrom
20251230-02
Jan 5, 2026
Merged

fix: avoid race condition when opening side channel#47
paodb merged 1 commit into
mainfrom
20251230-02

Conversation

@javier-godoy

Copy link
Copy Markdown
Member

The current implementation for opening and switching to a new browser window was causing intermittent test failures (flakiness).

((JavascriptExecutor) driver).executeScript("open(arguments[0],arguments[1])",
sideChannelUrl, sideChannelName);
driver.switchTo().window(sideChannelName);

The code was executing window.open() via JavaScript and immediately attempting to switchTo().window(). Because window.open() is handled asynchronously by the browser's UI thread, the WebDriver command to switch would often reach the browser before the browser had finished registering the new window handle.

Result: Selenium would throw an exception because the window name did not exist yet in the session's window list at the server side.

@sonarqubecloud

Copy link
Copy Markdown

@javier-godoy javier-godoy requested a review from paodb January 5, 2026 12:39
@paodb paodb merged commit 6a680d7 into main Jan 5, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from To Do to Pending release in Flowing Code Addons Jan 5, 2026
@paodb paodb deleted the 20251230-02 branch January 5, 2026 15:08
@paodb paodb moved this from Pending release to Done in Flowing Code Addons Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants