Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circle CI tests fail on Chrome with the testem disable-dev-shm-usage flag enabled #8536

Open
0xadada opened this issue Mar 29, 2019 · 0 comments

Comments

@0xadada
Copy link

0xadada commented Mar 29, 2019

Circle CI tests fail on Chrome >= 71 with the testem disable-dev-shm-usage flag enabled with the following error:

FATAL:gpu_data_manager_impl_private.cc(892)] The display compositor is frequently crashing. Goodbye

Full error

not ok 1 Chrome - [undefined ms] - error
    ---
        message: >
            Error: Browser exited unexpectedly
            Non-zero exit code: null
            Stderr: 
             Fontconfig warning: "/etc/fonts/fonts.conf", line 100: unknown element "blank"
            
            DevTools listening on ws://127.0.0.1:38833/devtools/browser/b48fcc54-a189-4e54-8c45-e2c46e81f798
            [0326/141652.369424:FATAL:gpu_data_manager_impl_private.cc(892)] The display compositor is frequently crashing. Goodbye.
            Failed to generate minidump.
            
        Log: |
            { type: 'error', text: 'Error: Browser exited unexpectedly' }
            { type: 'error', text: 'Non-zero exit code: null' }
            { type: 'error',
              text:
               'Fontconfig warning: "/etc/fonts/fonts.conf", line 100: unknown element "blank"\n\nDevTools listening on ws://127.0.0.1:38833/devtools/browser/b48fcc54-a189-4e54-8c45-e2c46e81f798\n[0326/141652.369424:FATAL:gpu_data_manager_impl_private.cc(892)] The display compositor is frequently crashing. Goodbye.\nFailed to generate minidump.' }
    ...

1..1
# tests 1
# pass  0
# skip  0
# fail  1
Testem finished with non-zero exit code. Tests failed.

Background

A new Google Chrome flag was introduced that will disable use of shm memory in favor of using the tmp directory as described in this chromium issue. That bug references this bug, which is pointing out that by default, docker sets the /dev/shm size to 64MB which often isn't enough for big web pages.

So disabling shm in testem.js helps tests running in Docker not run out of shared memory as it'll use a different memory mapping scheme:
https://github.com/ember-cli/ember-cli/blob/master/blueprints/app/files/testem.js#L17

While this flag is useful in some situations, for example on Travis CI, on Circle CI the tests run with a larger amount of memory, so disabling the shm system isn't required, and actually causes another problem.

CircleCI apparently runs the docker images with a higher /dev/shm limit, as indicated in this forum post (https://discuss.circleci.com/t/shared-memory-warnings/11761/7). I've confirmed that on the free tier the size is to 30G.

Fix

The fix would be to check for the existence of a CircleCI envionment variable set in all CI runs, and disable it similar to how we enable the --no-sandbox flag today.

process.env.CIRCLECI ? null : '--disable-dev-shm-usage',

Changes to testem.js to include this flag were done in the following commit: 9dbd15e#diff-f7e2d0d5944207cb98b51991f8da57b0

I'll implement this fix myself tomorrow 🍻

0xadada pushed a commit to 0xadada/ember-cli that referenced this issue Mar 29, 2019
checks for the existence of a CircleCI envionment variable `CIRCLECI=true` which
is set in all CI runs, and disable the flag similar to how we enable the
`--no-sandbox` flag for CI runs.

Different flag, inverse logic.

Fixes ember-cli#8536
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant