We are using drone for our CI and run Cypress inside drone to test our application (Angular 7).
All the test are running fine on my local machine, but in the CI the tests fail because Chrome Renderer crashed. Around 50% fail, even though they are really not long or complex (most of them just about 5-10 lines).
I know that this is a known issue (https://github.com/cypress-io/cypress/issues/350) and spent quite some time trying the various fixes that have been proposed online. I already tried:
The fix mostly promoted, setting --ipc=host does currently not work with drone (https://discourse.drone.io/t/does-drone-support-ipc-host-option/1049).
I am actually a bit confused because the original ticket explicitly states When running headlessly on very long and memory intense applications we are seeing renderer crashes with Docker.
I am quite sure that our application does neither qualify as very long
nor memory intense
(the page consumes around 50-80mb says Chrome Task Manager), so maybe our issue is actually something else?
Can anyone maybe give some more hints if I missed something here?
We were able to fix this by disabling Chrome's usage of /dev/shm
completely, by adding this to our plugins/index.js
-file.
From Cypress version 4 syntax:
on('before:browser:launch', (browser, launchOptions) => {
if (browser.name === 'chrome') {
launchOptions.args.push('--disable-dev-shm-usage')
}
return launchOptions
})
Until Cypress version 3 syntax:
on('before:browser:launch', (browser = {}, args) => {
if (browser.name === 'chrome') {
args.push('--disable-dev-shm-usage')
}
return args
})
Source: https://github.com/cypress-io/cypress/issues/350#issuecomment-574072211