testiumjs / testium-core

Juggling the bits and pieces to run integration tests
BSD 3-Clause "New" or "Revised" License
4 stars 7 forks source link

chore: add --disable-dev-shm-usage for chromeOptions #41

Closed amkirwan closed 5 years ago

amkirwan commented 5 years ago

See: https://bugs.chromium.org/p/chromium/issues/detail?id=736452

from Google Dev Troubleshooting: https://developers.google.com/web/tools/puppeteer/troubleshooting

By default, Docker runs a container with a /dev/shm shared memory space 64MB. This is typically too small for Chrome and will cause Chrome to crash when rendering large pages. To fix, run the container with docker run --shm-size=1gb to increase the size of /dev/shm. Since Chrome 65, this is no longer necessary. Instead, launch the browser with the --disable-dev-shm-usage flag:

jkrems commented 5 years ago

Can you add a chore commit to remove node 4 and add node 10 to the .travis.yml? That should make the build pass.

dbushong commented 5 years ago

Two quick thoughts:

  1. should we only do this by detecting docker? (existence of /.dockerenv seems like a cheap check)
  2. if that's too hard, we could make this an option, like chrome.disableDevShm and then you just do the run with testium_chrome__disableDevShm=1 mocha ...
dbushong commented 5 years ago

https://github.com/GoogleChrome/puppeteer/issues/1834 there's a discussion on whether or not to just default it on - they seemed to decide "no", but perhaps not for reasons we care about

amkirwan commented 5 years ago

@dbushong @jkrems I'm working on a way to only add the option when running in docker