Cypress 10.x.x hangs under Linux + Docker using cypress/included:10.2.0
See original GitHub issueCurrent behavior
Hello all,
we have the problem that Cypress local runs without problems. All tests are executed and the test run includes all test specs.
If we run the same code in a pipeline with the Docker image and Pipeline integration , it doesnβt work anymore.
The problem is that Cypress doesnβt do anything anymore except logging the CPU usage even though there are still test specs and tests to run.
Sometimes this happens during the first test spec, sometimes after another one. It is always different.
Via DEBUG=cypress:* npx cypress run
I logged everything and there is no error in the logs when Cypress stops working and only logs CPU usage until the pipeline times out.
This looks like this in the logs:
cypress:server:util:process_profiler current & mean memory and CPU usage by process group:
cypress:server:util:process_profiler βββββββββββ¬ββββββββββββββββββββ¬βββββββββββββββ¬βββββββββββββββββββββ¬βββββββββββββ¬βββββββββββββββββ¬βββββββββββ¬βββββββββββββββ¬ββββββββββββββ
cypress:server:util:process_profiler β (index) β group β processCount β pids β cpuPercent β meanCpuPercent β memRssMb β meanMemRssMb β maxMemRssMb β
cypress:server:util:process_profiler βββββββββββΌββββββββββββββββββββΌβββββββββββββββΌβββββββββββββββββββββΌβββββββββββββΌβββββββββββββββββΌβββββββββββΌβββββββββββββββΌββββββββββββββ€
cypress:server:util:process_profiler β 0 β 'Electron' β 1 β '256' β 19.08 β 15.89 β 373.65 β 278.85 β 373.65 β
cypress:server:util:process_profiler β 1 β 'electron-shared' β 4 β '36, 192, 37, 213' β 16.49 β 13.73 β 254.15 β 245.68 β 260.08 β
cypress:server:util:process_profiler β 2 β 'cypress' β 1 β '30' β 55.27 β 47.89 β 248.22 β 243.28 β 255.86 β
cypress:server:util:process_profiler β 3 β 'plugin' β 1 β '238' β 0.05 β 2.53 β 146.84 β 171.95 β 241.1 β
cypress:server:util:process_profiler β 4 β 'ffmpeg' β 1 β '251' β 1.25 β 1.2 β 76.43 β 72.46 β 76.43 β
cypress:server:util:process_profiler β 5 β 'other' β 2 β '999, 1000' β 0 β 0.03 β 3.4 β 3.39 β 3.45 β
cypress:server:util:process_profiler β 6 β 'TOTAL' β 10 β '-' β 92.14 β 80.68 β 1102.7 β 999.74 β 1106.26 β
cypress:server:util:process_profiler βββββββββββ΄ββββββββββββββββββββ΄βββββββββββββββ΄βββββββββββββββββββββ΄βββββββββββββ΄βββββββββββββββββ΄βββββββββββ΄βββββββββββββββ΄ββββββββββββββ +10s
I canβt tell for sure since the logs donβt indicate anything but it seems like the test runner is crashing or Cypress is losing connection to it, or it is a memory leak, but unfortunately it is impossible to tell from the missing log entries. It is very hard to trace but happens with every test run. We have had this problem for over a year nowβ¦
I canβt tell for sure since the logs donβt indicate anything but it seems like the test runner is crashing, the Chrome crahed (Aw, snap!) or Cypress is losing connection to it. It is very hard to trace but happens with every test run. We have had this problem for over a year nowβ¦
If you run the Docker image locally, without pipeline, then it works as well. So it must be the interaction between pipeline and Docker image.
Currently we are using Cypress 10.2.0
with Chrome 100
, but we had the problem also with Cypress 8.3.0
This happens also in Electron Browser. iβve tried "video": false, "numTestsKeptInMemory": 1 and 0
, and our index.js
in cypress/e2e/plugins
looks like this:
module.exports = (on, config) => {
on("before:browser:launch", (browser = {}, launchOptions) => {
if (browser.name === "chrome") {
launchOptions.args.push("--disable-gpu");
launchOptions.args = launchOptions.args.filter(
(Element) => Element !== "--disable-dev-shm-usage"
);
}
return launchOptions;
});
};
Desired behavior
Cypress no longer crashes during the pipeline run or spits out proper logs, after which you can see what the problem is.
Test code to reproduce
Since it fails on a different spec each time, it doesnβt seem to be related to actual test code
Cypress Version
10.x.x
Other
Cypress seems to be very resource-heavy. Our local computers run with 8 CPUs and the pipeline with 6 CPUs. in my opinion it cannot be due to our hardware resources
Issue Analytics
- State:
- Created a year ago
- Reactions:16
- Comments:18 (1 by maintainers)
Top GitHub Comments
On top of disabling the Command Log, disabling video recording has helped me to greatly reduce the frequency of hanging tests.
possibly related to https://github.com/cypress-io/cypress/issues/23391 which is being actively worked on. We will double check to see if this issue is resolved when work on the linked ticket is complete.