cypress: RangeError: Maximum call stack size exceeded at _deconstructPacket in CI Pipeline
Current behavior
Upgrading to cypress version 6.5.0 and running it on Bitbucket Pipeline CI via parallel tests, the error is encountered:
RangeError: Maximum call stack size exceeded
at _deconstructPacket (/root/.cache/Cypress/6.5.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:21:28)
at _deconstructPacket (/root/.cache/Cypress/6.5.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:40:32)
...
at _deconstructPacket (/root/.cache/Cypress/6.5.0/Cypress/resources/app/packages/socket/node_modules/socket.io-The Test Runner unexpectedly exited via a exit event with signal SIGILL
I’ve checked similar issues in the past and they have been fixed by succeeding Cypress versions. Could it be on the package.json and package-lock.json having the latest version Cypress v6.5.0
while my docker image is still pointing to cypress/base:14.15.4
Desired behavior
The Test runner should not exit in the CI pipeline and continue to generate test results.
Test code to reproduce
bitbucket-pipelines.yml
image: cypress/base:14.15.4
options:
max-time: 20
tests: &tests
name: Run tests
caches:
- node
- cypress
script:
- set +e # continue executing next steps regardless of errors
- cypress_version=$HOST npx cypress run --record --key $CYPRESS_DASHBOARD_KEY --parallel --ci-build-id $BITBUCKET_BUILD_NUMBER
artifacts:
- cypress/screenshots/**
- cypress/videos/**
- cypress/test-reports/mocha/*.json
- cypress/test-reports/junit.xml
pipelines:
default:
- step:
name: Prepare dependencies
caches:
- npm
- cypress
- node
script:
- npm ci
- npx @bahmutov/print-env BITBUCKET # let's see the environment variables right away
- parallel: # run N steps in parallel
- step:
<<: *tests
- step:
<<: *tests
- step:
<<: *tests
definitions:
caches:
npm: $HOME/.npm
cypress: $HOME/.cache/Cypress
Versions
Cypress version 6.5.0 Running locally on MacOS works fine. Running on Bitbucket pipeline CI is when the issue is encountered.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 31
- Comments: 47 (7 by maintainers)
Commits related to this issue
- repro for #15101 — committed to cypress-io/cypress by flotwig 3 years ago
The issue still persists on 7.0.0
This is a regression introduced in 6.5.0.
6.5.0 commits. I’ve narrowed it down to this PR where it was introduced: https://github.com/cypress-io/cypress/pull/14479 which is unfortunate because it is a gigantic commit, but hopefully this will help us track it down.
Issue not present: https://github.com/cypress-io/cypress/commit/0abb5efe90b7c573df9d509b6ebe5d4debd3dab2 Issue present: https://github.com/cypress-io/cypress/commit/af26fbebe6bc609132013a0493a116cc78bb1bd4
downgrade to 6.4.0 and it’s work… please fix this
Getting this on 7.1.0. Would like to use the new features in 7.1.0, but can’t until this issue is resolved.
Get this on 7.0.1
@CypressHarry I am still seeing it after upgrading to 6.6.0.
RangeError: Maximum call stack size exceeded at _deconstructPacket (/root/.cache/Cypress/6.6.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:21:28)
Same situation here. Running 5.6 fine, but cannot update to 7.1. Its killing our CI in DevOps.
@iondrimba Thank you for a reproducible example. I have seen this error in our own Cypress tests sometimes, it has not been reliable however. This example is great because it will error each time. But it relies on GitHub’s website which is not great because whatever is on github’s site could change and the test may not fail in the future.
Reproducible Example
package.json
@iondrimba Indeed crashes just fine on Arch Linux as well, I just needed to change git repo url to https://github.com/iondrimba/cypress_maximum_call_stack.git
Reproducible repo https://github.com/iondrimba/cypress_maximum_call_stack Cypress 7.1.0
I got this bug to occur consistently in open mode by making a request with a timeout that is shorter than the request takes. I made a small repo with a reproducible example: https://github.com/TimVee/deconstructPacked-bug.
Reverting the cypress to 6.4.0 has fixed this issue for some reason. Only one thing is common between @poponuts and my code is the definition part
This is also a reproducible example although a bit more finicky to reproduce since you have to stop/start the test in open mode. https://github.com/cypress-io/cypress/issues/15629#issuecomment-823492885
@poponuts I’ve tried 7.2.0 on this repo https://github.com/iondrimba/cypress_maximum_call_stack and the error still present.
Downgrading to
6.4.0
has also solved the issue for us, was experiencing it on6.5.0
up to6.8.0
.