question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BackstopJS hangs in Docker container

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
garriscommented, Nov 22, 2017

I just added a link to this issue in the Docs.

3reactions
questionmarccommented, Nov 22, 2017

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 my docker 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. 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

gg-components - npm
Backstop js visual regression tests may also need to be updated. To update jest snapshots: ... The third simply stops the docker container....
Read more >
Automatic Visual Regression Testing using containers for Web ...
When the main handler promise is resolved the docker container runtime stops the browsers and proceeds to either report an error or successful ......
Read more >
docker exec sh the input device is not a tty - You.com
It's a terminal interface that supports escape sequences, moving the cursor around, etc, that comes from the old days of dumb terminals attached...
Read more >
gg-components - npm Package Health Analysis - Snyk
Backstop js visual regression tests may also need to be updated. To update jest snapshots: ... The third simply stops the docker container....
Read more >
BackstopJS Docker Image
A self-contained Docker image to run BackstopJS with no external dependencies. Visual Regression Testing with BackstopJS in a Docker container. Features:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found