Docker-selenium: 3.5.3: Firefox tests hang with node-firefox image, works with node-firefox-debug

Created on 21 Sep 2017  路  15Comments  路  Source: SeleniumHQ/docker-selenium

Meta -

Image(s):
node-firefox
Docker-Selenium Image Version(s):
3.5.3 images
OS:
MacOS Sierra, Ubuntu 16.04

Expected Behavior -

Firefox launches as expected and tests run with node-firefox image.

Actual Behavior -

Tests run fine when using 3.5.3 node-firefox-debug image, but fail when using node-firefox image. Firefox appears to hang for all tests at the following message.

Tests run fine with node-firefox 3.4.0 image.

Sep 20, 2017 6:40:41 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C

Commands used -

For Hub

docker run -d -p 4444:4444 -e GRID_MAX_SESSION=5 --name selenium-hub selenium/hub:3.5.3

For Node

docker run -d -e NODE_MAX_INSTANCES=5 -e NODE_MAX_SESSION=5 --shm-size 2g -v /dev/shm:/dev/shm --link selenium-hub:hub selenium/node-firefox:3.5.3
R-awaiting-answer

All 15 comments

@diemol, @elgalu any thoughts why this might be happening? Can you try running some tests as well? Can I provide more information in terms of logs that might help understanding the issue?

Debugged this issue some more, and interestingly the Firefox launches and works as expected if I _don't_ maximize the window.

driver.manage().window().maximize();

Still not sure what the root cause is, since I found nothing of interest with the hub and node debug logs or the Docker daemon log. As stated above, I don't see the issue with node-firefox-debug but only with node-firefox image.

Hi @testphreak

I was able to reproduce it, initially I thought it was only with Java, so I tried it with JavaScript (also maximising the window), and the browser just hangs.
After that I executed the same test in a for loop, and it also got stuck in the debug image.

I cannot see right away the reason for it. We need to investigate a bit.

I tried a local build (master has Geckodriver 0.19), but it did not make any difference. We need to investigate deeper.

That was the first thing I tried. Did not help. Oddly there doesn't seem to be anything in the logs that might point to the issue. Maximizing works with 3.4.0 node-firefox image. So i doubt that this is a FF/geckodriver issue.

I started to go backwards in releases and I can see that the last version where this worked properly is node-firefox:3.4.0-einsteinium, after that this problem is present.

Now we need to start checking the commits after that release to understand where the problem comes from.

Comparing https://github.com/SeleniumHQ/docker-selenium/compare/3.4.0-einsteinium...3.4.0-francium:

A couple of changes in 3.4.0-francium that could make the container behave a little differently are:

  1. https://github.com/SeleniumHQ/docker-selenium/blob/3.4.0-francium/NodeFirefox/Dockerfile.txt#L39-L40

  2. Also, this was deleted in 3.4.0-francium: https://github.com/SeleniumHQ/docker-selenium/blob/3.4.0-einsteinium/NodeBase/entry_point.sh#L4

Otherwise, every other change in the diff appears to be related to upgrading versions.

https://github.com/SeleniumHQ/docker-selenium/commit/89d048cf53ebad48d0be64d7b18c01c065414616
This version upgrade started to make things weird, I'll start debugging from there.

Here are the things I've tried so far:

  • I took the commit from node-firefox:3.4.0-einsteinium (last known working version), and started upgrading Geckodriver, Firefox and Selenium until latest versions, and the problem is still there. Which means that the issue is related to either Geckodriver or FF. (It works in the debug versions, just as a reminder).
  • I tried upgrading Firefox to beta 56, which will be released tomorrow (28.09.2017), still no luck.
  • I tried then with Firefox 57 beta, which should be released in November, and it works again.

Next thing I will try downgrading Firefox and Geckodriver versions separately to identify what is the trigger for the error.
Also check why it works in the debug images, perhaps fluxbox or x11vnc make the difference.

Based on that, we can create an issue in Geckodriver/FF and then just wait until it gets resolved or FF 57 is released.

I checked all the combinations, the only one working was Geckodriver 0.17.0 and and FF 54.0.1.

After that, maximising the window does not work anymore. Which should be solved in FF 57 (based on my previous comment).

Why does it work in the debug image?
I installed and configured fluxbox manually in a running container, and after that, maximising kind of works. Opening, maximising and closing the browser works a few times, but if you do it more than 5-10 times, it hangs again (this also happens in the debug container).

What we can do for now is leave this issue open and create an issue in Mozilla and hopefully a fix gets released for the current 56 version.

@diemol thank you for sharing your findings. Since November is just a little more than a month away, maybe we can wait till Firefox 57 released?

For Firefox 55 and 56, we may be able to find useful information in Firefox browser log to see the error it is throwing on window maximize. We maybe able to set that with FirefoxProfile and ssh into the running container to view the log file once the test has run to see if there's any useful information there.

I think we just need to wait for a new FF release, I actually checked the container logs and it just hangs when the maximise instruction is received.
In the debug container, when that happens, if I maximise myself the browser when it is hanging, then the test continues.

Hi @testphreak,

Can you please check with the latest release?
https://github.com/SeleniumHQ/docker-selenium/releases/tag/3.7.1-beryllium

Firefox 57.0 is there, I tried it and it works. I also added a test maximising the window to our CI to keep track of this.

Hi @diemol, thank you for following up.

Tested with driver.manage().window().maximize(); with image selenium/node-firefox:3.7.1 (latest image with FF 57.0) and I don't see the issue any more.

Another fix in FF 57 that will benefit users, is you can now upload local files to remote browser without having to add firefoxOptions.addPreference("dom.file.createInChild", true);

Thanks again for updating to the latest versions!

Was this page helpful?
0 / 5 - 0 ratings