question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cypress 10.x.x hangs under Linux + Docker using cypress/included:10.2.0

See original GitHub issue

Current 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:open
  • Created a year ago
  • Reactions:16
  • Comments:18 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
PeterDekkerscommented, Sep 21, 2022

On top of disabling the Command Log, disabling video recording has helped me to greatly reduce the frequency of hanging tests.

1reaction
nagash77commented, Dec 19, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run Cypress with a single Docker command
I've tried this setup but I can't run the test runner from the container. When I launch it, it suddenly stops with exit...
Read more >
Viewing The Interactive Cypress Test Runner In Docker On ...
To run any GUI application in a docker container you've got to understand how X Window System works. X uses client-server model.
Read more >
cypress-io/cypress@2.2.0
1 2 3 4 5 6 7 8 9 10 11 12 13 version: 2.1 orbs: cypress: cypress-io/cypress@1 executors: with-chrome: docker: - image:Β ......
Read more >
Dockerize your Cypress tests | Johnny Metz
See the source code for a working example. UI testing is a critical part of any modern web application. My favorite testing framework...
Read more >
Image Layer Details - cypress/base:ubuntu18-node12.14.1
Wasm is a fast, light alternative to Linux containers – try it out today with the Docker+Wasm Beta. βœ•.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found