From 3bf31352fef4c42b8db19c206fab87bf891363e1 Mon Sep 17 00:00:00 2001 From: Cecelia Martinez <60482585+CypressCecelia@users.noreply.github.com> Date: Fri, 27 Mar 2020 04:25:35 -0400 Subject: [PATCH] adds /dev/shm workaround to Docker common problems section in CI (#2641) * adds /dev/shm workaround to Docker common problems section in CI guide for issue #2621 * Update source/guides/guides/continuous-integration.md Co-Authored-By: Jennifer Shehane * Update source/guides/guides/continuous-integration.md Co-Authored-By: Jennifer Shehane * Update source/guides/guides/continuous-integration.md * Update source/guides/guides/continuous-integration.md * Update source/guides/guides/continuous-integration.md * Update source/guides/guides/continuous-integration.md Co-authored-by: Jennifer Shehane --- source/guides/guides/continuous-integration.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source/guides/guides/continuous-integration.md b/source/guides/guides/continuous-integration.md index 5696f2d882..9eca823a06 100644 --- a/source/guides/guides/continuous-integration.md +++ b/source/guides/guides/continuous-integration.md @@ -700,6 +700,19 @@ See {% url bahmutov/yarn-cypress-cache https://github.com/bahmutov/yarn-cypress- If you are running long runs on Docker, you need to set the `ipc` to `host` mode. {% issue 350 'This issue' %} describes exactly what to do. +In a Docker container, the default size of the `/dev/shm` shared memory space is 64MB. This is not typically enough to run Chrome and can cause the browser to crash. You can fix this by passing the `--disable-dev-shm-usage` flag to Chrome with the following workaround: + +```javascript +module.exports = (on, config) => { + on('before:browser:launch', (browser = {}, launchOptions) => { + if (browser.family === 'chromium' && browser.name !== 'electron') { + launchOptions.args.push('--disable-dev-shm-usage') + } + + return launchOptions + }) +} +``` ## Xvfb When running on Linux, Cypress needs an X11 server; otherwise it spawns its own X11 server during the test run. When running several Cypress instances in parallel, the spawning of multiple X11 servers at once can cause problems for some of them. In this case, you can separately start a single X11 server and pass the server's address to each Cypress instance using `DISPLAY` variable.