[🐛 Bug]: Using CDP on Firefox makes the grid unstable
See original GitHub issueWhat happened?
Unfortunately I’m currently not really sure where the issue is located. Could be geckodriver, selenium grid, selenium node, docker-selenium.
We are able to get developer console logs via the following code:
WebDriver driver = new Augmenter().augment(this.driver);
DevTools devTools = ((HasDevTools) driver).getDevTools();
devTools.createSession();
// Disable logger for selenium package
Logger.getLogger("org.openqa.selenium").setLevel(Level.OFF);
// Override stderr to somehow bring disabled logger in effect (no clue why this is needed)
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream newStdErr = new PrintStream(baos);
System.setErr(newStdErr);
devTools.getDomains().events().addConsoleListener(
event -> {
logManager.addEntry(new LogEntry(
logManager.toLevel(event.getType()),
// Adding offset for time zone
event.getTimestamp().getEpochSecond(),
event.getArgs().toString()
)
);
}
);
This creates a lot of exceptions on the java side which we only can partly disable by overriding the logger. You can see above that we additionally needed to reset stderr to not flood our test output with these exception output that seems to come directly on stderr and is not catchable.
One issue remains: The grid becomes quite unstable with the above code and usually breaks after 3-4 days. We have seens two different behaviours:
- selenium grid hub is still reachable, but shows “loading…” for all grid nodes (all docker-selenium containers are all still marked healthy)
- selenium grid hub not reachable anymore (docker-selenium containers for the grid hub are unhealthy)
We currently run:
- docker-selenium 4.4.0-20220831
- selenium-java is on version 4.1.1 (we unfortunately cannot update to 4.4.0 due to dependency issues)
How can we reproduce the issue?
This is not easy to reproduce. We have test runs with over 1200 tests in one suite which run usually 2 times a day. Only after 2-5 days it breaks.
Relevant log output
Will add logs once it happens again
Operating System
debian
Selenium version
Java 4.1.1
What are the browser(s) and version(s) where you see this issue?
Firefox 105
What are the browser driver(s) and version(s) where you see this issue?
GeckoDriver: 0.31.0
Are you using Selenium Grid?
docker-selenium 4.4.0-20220831
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
1612355 - Render/Layout-Performance Issues with Grid-Layout
Issues with CSS grid layout. Example bugs: stretching the inline size of <button> grid items doesn't work; abspos child of a grid should...
Read more >Support for Chrome Devtools Protocol (CDP) - Bugzilla@Mozilla
Firefox Desktop ships with CDP in nightly builds (enabled build-time with the --enable-cdp flag) since some time now. This is great because it...
Read more >Auto-tools/Projects - MozillaWiki
ID Summary Status Bug mentor
366932 Transfer‑Encoding: chunked on incoming requests NEW No bug_mentor
371075 should reftest use CheckLoadURI? NEW No bug_mentor
393063 Add ability to...
Read more >mozilla-central: changeset 605996 ... - Mercurial
Bug 1746154 - [cdp] Add error message and documentation about the required ... To keep using CDP for Firefox, make sure the following ......
Read more >Mozilla Bug Bounty Program Doubles Payouts, Adds Firefox ...
Mozilla is bumping up its bug bounty payouts and has added new websites and services – including the recently deployed Firefox Monitor– to ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

To add to this, similar errors in terms of showing loading state and Grid being stuck were fixed thanks to Diego’s work https://github.com/SeleniumHQ/selenium/commit/f569d7f6b1f2a35ea41d9604cdc69dbbd5f58485 . The cause of the error was different but it caused the “loading…” state of the GridUI. The changes will be available as part of the release. I am hoping the fix helps for this scenario as well.
We were not able to reproduce this exactly with CDP.
selenium grid hub is still reachable, but shows "loading..." for all grid nodes (all docker-selenium containers are all still marked healthy)- this bit was fixed in 4.6. But if something else is causing it then we can reopen the issue. @mythsunwind Can you please try with 4.6 and let us know? Thank you!