Cypress unexpectedly and randomly hangs when running tests in CI
See original GitHub issueCurrent behavior:
We have tests running in Jenkins using docker and docker-compose for running micro-services. Many containers spin up and one is used for our app UI, but these are not the problem.
Since upgrading to Cypress 3.0.1, we’ve been noticing that random builds just stall out and never complete. As a result of this we’ve had to instate a 30minute timeout on Jenkins jobs. There are no errors visible in the console output so its hard to see what is happening. The exact same codebase, less some changes to upgrade to Cypress 3, worked on Cypress 2.1.0 perfectly fine up until we upgraded. Like this issue, it will run an random number of specs and stall. Everything runs fine using the headed mode, it seems to only affect headless mode.
Below is some log output from invoking Cypress with DEBUG=cypress:* ./node_modules/.bin/cypress run --env configFile=ci --reporter mocha-multi-reporters --reporter-options configFile=cypress/config/reporters.json
[... everything is great up until this point]
Running: test_spec.js... (16 of 16)
Sat, 09 Jun 2018 00:08:04 GMT cypress:server:run about to run spec { spec: { name: 'test_spec.js', path: 'cypress/integration/test_spec.js', absolute: '/tests/cypress/integration/test_spec.js' }, headed: undefined, browserName: 'electron' }
Sat, 09 Jun 2018 00:08:04 GMT cypress:server:video ffmpeg started
Sat, 09 Jun 2018 00:08:04 GMT cypress:server:project launching browser electron spec /tests/cypress/integration/test_spec.js
Sat, 09 Jun 2018 00:08:04 GMT cypress:server:project resetting project instance /tests
Sat, 09 Jun 2018 00:08:04 GMT cypress:server:server Setting remoteAuth undefined
Sat, 09 Jun 2018 00:08:04 GMT cypress:server:cors Parsed URL { port: '15901', tld: 'localhost', domain: '' }
Sat, 09 Jun 2018 00:08:04 GMT cypress:server:server Setting remoteOrigin http://localhost:15901
Sat, 09 Jun 2018 00:08:04 GMT cypress:server:server Setting remoteHostAndPort { port: '15901', tld: 'localhost', domain: '' }
Sat, 09 Jun 2018 00:08:04 GMT cypress:server:server Setting remoteDocDomain localhost
Sat, 09 Jun 2018 00:08:04 GMT cypress:server:server Getting remote state: { auth: undefined, props: { port: '15901', tld: 'localhost', domain: '' }, origin: 'http://localhost:15901', strategy: 'http', visiting: false, domainName: 'localhost', fileServer: null }
Sat, 09 Jun 2018 00:08:04 GMT cypress:server:timers queuing timer id 2034 after 30000 ms
Sat, 09 Jun 2018 00:08:04 GMT cypress:server:timers child received timer id 2034
Sat, 09 Jun 2018 00:08:04 GMT cypress:server:project launching project in browser electron
Sat, 09 Jun 2018 00:08:04 GMT cypress:server:browsers opening browser electron
Sat, 09 Jun 2018 00:08:04 GMT cypress:server making saved state from /root/.cache/Cypress/3.0.1/Cypress/resources/app/packages/server
Sat, 09 Jun 2018 00:08:04 GMT cypress:server for project path /tests
Sat, 09 Jun 2018 00:08:04 GMT cypress:server state path for project /tests
Sat, 09 Jun 2018 00:08:04 GMT cypress:server:appdata path: /root/.config/Cypress/cy/production/projects/tests-7304f32fd2c23aa2ad65c4f536e3c192/state.json
Sat, 09 Jun 2018 00:08:04 GMT cypress:server full state path /root/.config/Cypress/cy/production/projects/tests-7304f32fd2c23aa2ad65c4f536e3c192/state.json
Sat, 09 Jun 2018 00:08:05 GMT cypress:server:file reading JSON file /root/.config/Cypress/cy/production/projects/tests-7304f32fd2c23aa2ad65c4f536e3c192/state.json
Sat, 09 Jun 2018 00:08:05 GMT cypress:server:timers child sending timer id 1468
Sat, 09 Jun 2018 00:08:05 GMT cypress:server:timers child sending timer id 1469
Sat, 09 Jun 2018 00:08:05 GMT cypress:server:timers child sending timer id 1470
Sat, 09 Jun 2018 00:08:05 GMT cypress:server:timers child sending timer id 1471
Sat, 09 Jun 2018 00:08:05 GMT cypress:server:timers child sending timer id 1472
Sat, 09 Jun 2018 00:08:05 GMT cypress:server:timers child sending timer id 1473
Sat, 09 Jun 2018 00:08:05 GMT cypress:server:timers child sending timer id 1474
Sat, 09 Jun 2018 00:08:05 GMT cypress:server:timers child sending timer id 1475
[... repeats a few hundred timer ids then just stops]
Desired behavior:
All tests to run and output correct information regardless of fail or passing
Steps to reproduce:
It’s bizarre, I’m not quite sure how to reproduce it reliably as it seems completely random, and only happens about 30% of the time.
NOTE: I cannot recreate a reproducible test case with https://github.com/cypress-io/cypress-test-tiny as it just passes ever single run using Jenkins.
Versions
Cypress 3.0.1 + cypress/base:10 docker image Jenkins 2.89.3
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:20 (3 by maintainers)
Top GitHub Comments
@brandonb927 @kamituel @ikornienko We’ve investigated this - and we’re still unsure where this could be happening. We fixed the state stuff in
3.0.2
and we’ve added more debugging logs all around this area.Currently we we cannot reproduce this locally or in CI, so we’ll release
3.0.3
with more debug logs. Once you guys upgrade please post your updated logs here so we can help pinpoint the exact area that it’s hanging.We still see this issue happening to our builds with
3.0.2
release (same as for the author of this issue, it started to happen only after upgrading to3.0.1
), the debug output (with file paths being changed / obfuscated):And then it stops, and the build is killed by CircleCI with “Too long with no output (exceeded 10m0s)”. Same as for the author of this issue, it’s not obvious how to reproduce it, sometimes it hangs, sometimes it doesn’t.
@brian-mann @jennifer-shehane do you want to reopen this issue, or should it be a new one?