BackstopJS hangs in Docker container
See original GitHub issueI seem to keep having this problem where the chrome headless hangs forever until the script ends. Here’s the output I’m seeing:
Starting Chromy: {"chromeFlags":["--disable-gpu","--force-device-scale-factor=1","--disable-infobars=true","--no-sandbox","--window-size=320,480"],"port":9222,"waitTimeout":30000,"visible":false}
Starting Chromy: {"chromeFlags":["--disable-gpu","--force-device-scale-factor=1","--disable-infobars=true","--no-sandbox","--window-size=1024,768"],"port":9223,"waitTimeout":30000,"visible":false}
Starting Chromy: {"chromeFlags":["--disable-gpu","--force-device-scale-factor=1","--disable-infobars=true","--no-sandbox","--window-size=1600,900"],"port":9224,"waitTimeout":30000,"visible":false}
9223 Chrome v61 detected.
9223 ***WARNING! CHROME VERSION 62 OR GREATER IS REQUIRED. PLEASE UPDATE YOUR CHROME APP!***
9222 Chrome v61 detected.
9222 ***WARNING! CHROME VERSION 62 OR GREATER IS REQUIRED. PLEASE UPDATE YOUR CHROME APP!***
9224 Chrome v61 detected.
9224 ***WARNING! CHROME VERSION 62 OR GREATER IS REQUIRED. PLEASE UPDATE YOUR CHROME APP!***
bash-4.3#
This is utilizing the same dockerfile as the one listed in the repo. I’m not sure why it’s hanging but I don’t get any real output. Changing the engine to PhantomJS works, and from looking at the debug output from the debug
flag, it is reaching the webpage. I tried adding some flags to the docker run
from reading this project: https://github.com/yukinying/chrome-headless-browser-docker . I also tried to add the --no-sandbox
option to the chromeFlags
but to no avail.
So I’m not sure if this is a chrome-headless issue? An issue with chromium v61? Alpine? I’m also not sure how to debug this further.
If you have any insight as to things I could be doing to make progress, please let me know.
Issue Analytics
- State:
- Created 6 years ago
- Comments:17 (6 by maintainers)
Top GitHub Comments
I just added a link to this issue in the Docs.
Ok… I solved the issue. It was a docker issue all along. 😓 Linking the reference material that got me to solving the problem (which was ironically because I was doing research into alternatives to chromy and found puppeteer): https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#tips
essentially adding
--shm-size=2gb
and--cap-add=SYS_ADMIN
to mydocker run
command let chrome have enough shared memory to finish running the test.What was probably happening was that the chrome process was running out of shared memory and couldn’t finish loading the page (huge page, lots of assets, etc…) So then when that occurred, it was being treated as a gotoTimeout because it couldn’t load the page with the shared space provided by docker by default (which is 64mb by default).
After increasing the shared memory size to 2gbs the process completed successfully. 😄