You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When retries are enabled and a test is flaky (i.e. fails at the beginning, then passes in a later retry), the results reported in the "after:run" hook contain duplicate attempts.
describe('page',()=>{it('works',()=>{cy.visit('https://example.cypress.io');// simulate a flaky test that passes on the third attemptif(Cypress.currentRetry<2){expect(true).to.eq(false)}else{expect(true).to.eq(true)}})})
Interestingly, this does not occur when the test does not contain any Cypress command:
describe('page',()=>{it('works',()=>{// no cypress visit, but still flakyif(Cypress.currentRetry<2){expect(true).to.eq(false)}else{expect(true).to.eq(true)}})})
Current behavior
When retries are enabled and a test is flaky (i.e. fails at the beginning, then passes in a later retry), the results reported in the
"after:run"
hook contain duplicate attempts.Config file:
The results reported:
Desired behavior
In this situation, Cypress should only report two failing and one passing attempt.
Test code to reproduce
npm install
npx cypress run
results.json
Cypress Version
13.17.0
Node version
v22.11.0
Operating System
Windows 10 Pro 19045.5247
Debug Logs
No response
Other
Interestingly, this does not occur when the test does not contain any Cypress command:
The reported results:
I hope this is not a duplicate issue, I failed to find anything using GitHub's search.
The text was updated successfully, but these errors were encountered: