Open SplikStick opened 1 year ago
This issue could be related to #26248 ?
Hi @SplikStick and sorry for the delayed response here. I am really curious about this and would love to reproduce it to debug. I feel like even with the information provided this is challenging to solve as it would involve speculating about places a race condition may be occurring that leads to this outcome X% of the time in your project.
If you are able to make something with https://github.com/cypress-io/cypress-test-tiny that reproduces this even rarely it would help.
Maybe running tests this way:
Cypress._.times(100, () => {
// let's see what happens
})
@mirobo it's a good point that Socket closed before ...
is a good starting point and these may be related. In which case we should test this again when https://github.com/cypress-io/cypress/issues/26248 is worked on.
If we are able to reproduce the behavior in this ticket I will forward it to the team as well.
In the absence of a reproduction or other activity for a week, I'm going to close this one for now. But we can open it up again when there is a reproduction available or more info to discuss, so please do update the issue with new information when ready.
I have the same issue and I tried to create a reproduction without success for now. https://github.com/Akryum/cypress-issue-26431
I repeatedly ran one specific test in the project at work, and got this error 11 times out of 20. It's making the tests very flaky :(
It is basically failing here because req.body
is ''
.
```shell
seq 20 | xargs -I{} pnpm exec cypress run --component -s src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js
====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 13.1.0 │
│ Browser: Electron 106 (headless) │
│ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │
│ Specs: 1 found (SectionSessions.cy.js) │
│ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: SectionSessions.cy.js (1 of 1)
Dashboard - Events - Sessions - Session Management - Create
✓ should be able to create a session with permission (1068ms)
✓ should not be able to create a session without permission (225ms)
✓ should not be able to create a session with an on-demand event (72ms)
✓ should be able to edit a session with permission (226ms)
✓ should not be able to edit a session without permission (204ms)
5 passing (2s)
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Tests: 5 │
│ Passing: 5 │
│ Failing: 0 │
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: true │
│ Duration: 1 second │
│ Spec Ran: SectionSessions.cy.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
(Video)
- Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4
====================================================================================================
(Run Finished)
Spec Tests Passing Failing Pending Skipped
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ✔ SectionSessions.cy.js 00:01 5 5 - - - │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
✔ All specs passed! 00:01 5 5 - - -
====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 13.1.0 │
│ Browser: Electron 106 (headless) │
│ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │
│ Specs: 1 found (SectionSessions.cy.js) │
│ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: SectionSessions.cy.js (1 of 1)
Dashboard - Events - Sessions - Session Management - Create
✓ should be able to create a session with permission (1096ms)
✓ should not be able to create a session without permission (233ms)
✓ should not be able to create a session with an on-demand event (64ms)
(Attempt 1 of 3) should be able to edit a session with permission
(Attempt 2 of 3) should be able to edit a session with permission
1) should be able to edit a session with permission
(Attempt 1 of 3) should not be able to edit a session without permission
(Attempt 2 of 3) should not be able to edit a session without permission
2) should not be able to edit a session without permission
3 passing (3s)
2 failing
1) Dashboard - Events - Sessions - Session Management - Create
should be able to edit a session with permission:
Error: Body must be a string. Received: undefined.
at devAssert (http://localhost:9001/__cypress/src/node_modules/.vite/deps/chunk-3POMOEZK.js?v=49eabcde:751:11)
at new Source2 (http://localhost:9001/__cypress/src/node_modules/.vite/deps/chunk-3POMOEZK.js?v=49eabcde:842:37)
at new Parser2 (http://localhost:9001/__cypress/src/node_modules/.vite/deps/chunk-3POMOEZK.js?v=49eabcde:1394:53)
at parse (http://localhost:9001/__cypress/src/node_modules/.vite/deps/chunk-3POMOEZK.js?v=49eabcde:1358:16)
at processGraphQLRequest (http://localhost:9001/__cypress/src/tests/cypress/support/graphql.js:89:21)
at
Interestingly if I only run one test in that test file, I never get the error out of the 20 runs:
```shell ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.1.0 │ │ Browser: Electron 106 (headless) │ │ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │ │ Specs: 1 found (SectionSessions.cy.js) │ │ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: SectionSessions.cy.js (1 of 1) Dashboard - Events - Sessions - Session Management - Create ✓ should be able to create a session with permission (1275ms) 1 passing (1s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 1 second │ │ Spec Ran: SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ SectionSessions.cy.js 00:01 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 00:01 1 1 - - - ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.1.0 │ │ Browser: Electron 106 (headless) │ │ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │ │ Specs: 1 found (SectionSessions.cy.js) │ │ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: SectionSessions.cy.js (1 of 1) Dashboard - Events - Sessions - Session Management - Create ✓ should be able to create a session with permission (1237ms) 1 passing (1s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 1 second │ │ Spec Ran: SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ SectionSessions.cy.js 00:01 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 00:01 1 1 - - - ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.1.0 │ │ Browser: Electron 106 (headless) │ │ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │ │ Specs: 1 found (SectionSessions.cy.js) │ │ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: SectionSessions.cy.js (1 of 1) Dashboard - Events - Sessions - Session Management - Create ✓ should be able to create a session with permission (1278ms) 1 passing (1s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 1 second │ │ Spec Ran: SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ SectionSessions.cy.js 00:01 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 00:01 1 1 - - - ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.1.0 │ │ Browser: Electron 106 (headless) │ │ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │ │ Specs: 1 found (SectionSessions.cy.js) │ │ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: SectionSessions.cy.js (1 of 1) Dashboard - Events - Sessions - Session Management - Create ✓ should be able to create a session with permission (1220ms) 1 passing (1s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 1 second │ │ Spec Ran: SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ SectionSessions.cy.js 00:01 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 00:01 1 1 - - - ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.1.0 │ │ Browser: Electron 106 (headless) │ │ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │ │ Specs: 1 found (SectionSessions.cy.js) │ │ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: SectionSessions.cy.js (1 of 1) Dashboard - Events - Sessions - Session Management - Create ✓ should be able to create a session with permission (1267ms) 1 passing (1s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 1 second │ │ Spec Ran: SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ SectionSessions.cy.js 00:01 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 00:01 1 1 - - - ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.1.0 │ │ Browser: Electron 106 (headless) │ │ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │ │ Specs: 1 found (SectionSessions.cy.js) │ │ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: SectionSessions.cy.js (1 of 1) Dashboard - Events - Sessions - Session Management - Create ✓ should be able to create a session with permission (1230ms) 1 passing (1s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 1 second │ │ Spec Ran: SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ SectionSessions.cy.js 00:01 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 00:01 1 1 - - - ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.1.0 │ │ Browser: Electron 106 (headless) │ │ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │ │ Specs: 1 found (SectionSessions.cy.js) │ │ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: SectionSessions.cy.js (1 of 1) Dashboard - Events - Sessions - Session Management - Create ✓ should be able to create a session with permission (1199ms) 1 passing (1s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 1 second │ │ Spec Ran: SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ SectionSessions.cy.js 00:01 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 00:01 1 1 - - - ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.1.0 │ │ Browser: Electron 106 (headless) │ │ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │ │ Specs: 1 found (SectionSessions.cy.js) │ │ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: SectionSessions.cy.js (1 of 1) Dashboard - Events - Sessions - Session Management - Create ✓ should be able to create a session with permission (1194ms) 1 passing (1s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 1 second │ │ Spec Ran: SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ SectionSessions.cy.js 00:01 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 00:01 1 1 - - - ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.1.0 │ │ Browser: Electron 106 (headless) │ │ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │ │ Specs: 1 found (SectionSessions.cy.js) │ │ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: SectionSessions.cy.js (1 of 1) Dashboard - Events - Sessions - Session Management - Create ✓ should be able to create a session with permission (1227ms) 1 passing (1s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 1 second │ │ Spec Ran: SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ SectionSessions.cy.js 00:01 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 00:01 1 1 - - - ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.1.0 │ │ Browser: Electron 106 (headless) │ │ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │ │ Specs: 1 found (SectionSessions.cy.js) │ │ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: SectionSessions.cy.js (1 of 1) Dashboard - Events - Sessions - Session Management - Create ✓ should be able to create a session with permission (1254ms) 1 passing (1s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 1 second │ │ Spec Ran: SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ SectionSessions.cy.js 00:01 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 00:01 1 1 - - - ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.1.0 │ │ Browser: Electron 106 (headless) │ │ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │ │ Specs: 1 found (SectionSessions.cy.js) │ │ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: SectionSessions.cy.js (1 of 1) Dashboard - Events - Sessions - Session Management - Create ✓ should be able to create a session with permission (1214ms) 1 passing (1s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 1 second │ │ Spec Ran: SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ SectionSessions.cy.js 00:01 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 00:01 1 1 - - - ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.1.0 │ │ Browser: Electron 106 (headless) │ │ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │ │ Specs: 1 found (SectionSessions.cy.js) │ │ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: SectionSessions.cy.js (1 of 1) Dashboard - Events - Sessions - Session Management - Create ✓ should be able to create a session with permission (1214ms) 1 passing (1s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 1 second │ │ Spec Ran: SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ SectionSessions.cy.js 00:01 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 00:01 1 1 - - - ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.1.0 │ │ Browser: Electron 106 (headless) │ │ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │ │ Specs: 1 found (SectionSessions.cy.js) │ │ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: SectionSessions.cy.js (1 of 1) Dashboard - Events - Sessions - Session Management - Create ✓ should be able to create a session with permission (1245ms) 1 passing (1s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 1 second │ │ Spec Ran: SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ SectionSessions.cy.js 00:01 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 00:01 1 1 - - - ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.1.0 │ │ Browser: Electron 106 (headless) │ │ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │ │ Specs: 1 found (SectionSessions.cy.js) │ │ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: SectionSessions.cy.js (1 of 1) Dashboard - Events - Sessions - Session Management - Create ✓ should be able to create a session with permission (1226ms) 1 passing (1s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 1 second │ │ Spec Ran: SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ SectionSessions.cy.js 00:01 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 00:01 1 1 - - - ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.1.0 │ │ Browser: Electron 106 (headless) │ │ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │ │ Specs: 1 found (SectionSessions.cy.js) │ │ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: SectionSessions.cy.js (1 of 1) Dashboard - Events - Sessions - Session Management - Create ✓ should be able to create a session with permission (1187ms) 1 passing (1s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 1 second │ │ Spec Ran: SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ SectionSessions.cy.js 00:01 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 00:01 1 1 - - - ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.1.0 │ │ Browser: Electron 106 (headless) │ │ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │ │ Specs: 1 found (SectionSessions.cy.js) │ │ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: SectionSessions.cy.js (1 of 1) Dashboard - Events - Sessions - Session Management - Create ✓ should be able to create a session with permission (1166ms) 1 passing (1s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 1 second │ │ Spec Ran: SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ SectionSessions.cy.js 00:01 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 00:01 1 1 - - - ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.1.0 │ │ Browser: Electron 106 (headless) │ │ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │ │ Specs: 1 found (SectionSessions.cy.js) │ │ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: SectionSessions.cy.js (1 of 1) Dashboard - Events - Sessions - Session Management - Create ✓ should be able to create a session with permission (1189ms) 1 passing (1s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 1 second │ │ Spec Ran: SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ SectionSessions.cy.js 00:01 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 00:01 1 1 - - - ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.1.0 │ │ Browser: Electron 106 (headless) │ │ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │ │ Specs: 1 found (SectionSessions.cy.js) │ │ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: SectionSessions.cy.js (1 of 1) Dashboard - Events - Sessions - Session Management - Create ✓ should be able to create a session with permission (1239ms) 1 passing (1s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 1 second │ │ Spec Ran: SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ SectionSessions.cy.js 00:01 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 00:01 1 1 - - - ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.1.0 │ │ Browser: Electron 106 (headless) │ │ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │ │ Specs: 1 found (SectionSessions.cy.js) │ │ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: SectionSessions.cy.js (1 of 1) Dashboard - Events - Sessions - Session Management - Create ✓ should be able to create a session with permission (1234ms) 1 passing (1s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 1 second │ │ Spec Ran: SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ SectionSessions.cy.js 00:01 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 00:01 1 1 - - - ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.1.0 │ │ Browser: Electron 106 (headless) │ │ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │ │ Specs: 1 found (SectionSessions.cy.js) │ │ Searched: src/dashboard/components/EventTypePage/sections/SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: SectionSessions.cy.js (1 of 1) Dashboard - Events - Sessions - Session Management - Create ✓ should be able to create a session with permission (1246ms) 1 passing (1s) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: true │ │ Duration: 1 second │ │ Spec Ran: SectionSessions.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Video output: /home/akryum/Projects/livestorm-app/packages/frontend/tests/cypress/videos/SectionSessions.cy.js.mp4 ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ ✔ SectionSessions.cy.js 00:01 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! 00:01 1 1 - - - ```
I'm able to reproduce the error in the reproduction I shared above (https://github.com/Akryum/cypress-issue-26431) (updated today)
Example of terminal output:
```shell
====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 13.1.0 │
│ Browser: Electron 106 (headless) │
│ Node Version: v16.20.2 (/home/akryum/.local/share/pnpm/nodejs/16.20.2/bin/node) │
│ Specs: 1 found (Meow.cy.js) │
│ Searched: **/*.cy.{js,jsx,ts,tsx} │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: Meow.cy.js (1 of 1)
Meow.vue
✓ loads meows (154ms)
✓ no meows (22ms)
1) one meow
2) one more meow
✓ no meows again (39ms)
3) loads meows again?
3 passing (903ms)
3 failing
1) Meow.vue
one meow:
Error: Body must be a string. Received: undefined.
at devAssert (http://localhost:5173/__cypress/src/node_modules/.vite/deps/chunk-4IX6L4QI.js?v=784f6a21:669:11)
at new Source2 (http://localhost:5173/__cypress/src/node_modules/.vite/deps/chunk-4IX6L4QI.js?v=784f6a21:740:33)
at new Parser2 (http://localhost:5173/__cypress/src/node_modules/.vite/deps/chunk-4IX6L4QI.js?v=784f6a21:1258:49)
at parse (http://localhost:5173/__cypress/src/node_modules/.vite/deps/chunk-4IX6L4QI.js?v=784f6a21:1239:16)
at processGraphQLRequest (http://localhost:5173/__cypress/src/cypress/support/graphql.js:27:21)
at
Putting .only
on the first test in Meow.cy.js
seems to significantly reduce the number of error (I don't get any on 20 runs).
This is very helpful, thanks @Akryum! I'm going to re-open the issue.
@Akryum I did get this to reproduce with your repo, though only saw the failure in 2/100 runs. Also I needed to install Vue into the project - if you can update the package.json to include Vue at a specific version that would be helpful.
Given that we have different rates of failure and likely different specs on our machines, I am curious if you increase the resources available in CI do you see a decline in flake related to this issue? Not suggesting it as a permanent change, just to help confirm if it's resource related.
would be great to have it fixed. this struck us constantly with out runs...
I have the same issue on version v13.6.2
Same with 13.6.1
it's a real drag (of course I love and appreciate cypress and its devs though!). I will add as well, that I've only looked at this locally so far, and it does seem like a resource issue. If I start the test runner, and run the offending test, it appears to work consistently on that first run, but then with a super high failure rate thereafter (i.e. response.body = ''
).
If anyone has some easy work arounds beyond re-engineering the whole test would love to know.
Hello @jennifer-shehane can you please tell when this can be taken? Would be great to have this fixed
@romek-buildops We would review a PR to address this, our team is not currently prioritizing this.
Current behavior
I have simplified the problem to it's bare bones and censored out any sensitive information.
(Referring to the Test Code) When submitting the form on our webpage, a request to urlA is expected to have the formdata from that submission in application/x-www-form-urlencoded format but randomly request.body is an empty string.
I am waiting on '@aliasA' in order to be able to validate the payload of the request to urlA. Referring to Image A, I can see that Cypress is able to match the requests to my interceptions properly. The expected payload is available in the matched interception. I didn't screenshot it but the network tab also reveals the same with the payload being available.
But on random occasions (often enough to warrant writing a bug about it), I will receive the error in Image B. When viewing the error in more details, I see "Error: Socket closed before finished writing response at...".
Image A
Image B
Desired behavior
For the request.body to be available 100% of the time when waiting on the interception.
Test code to reproduce
Cypress Version
12.4.1 - 12.9.0
Node version
v14.17.3
Operating System
Windows 64-bit operating system Windows 10 Pro 22H2
Debug Logs
No response
Other
Other possible relevant information
beforeEach
as Cypress commands.@cypress/xpath
and@faker-js/faker
Things I have tried
expect(request.body).deep.contains(expectedPayload);
inside the interception itself before and after thereq.redirect()
.