-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix flakey tests #3227
fix flakey tests #3227
Conversation
ironically another flaky test just failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the timers aren't fired while the page is transition that's a bigger problem and one that we need to investigate and try to fix for real...
i can pair with you on it
1add788
to
623c4f0
Compare
623c4f0
to
f98bad0
Compare
since this moves the chains, can it go ahead and go in? |
absolutely |
// there were times where the driver's webserver | ||
// was sending bytes after 200ms (TTFB) that caused | ||
// this test to be flaky. | ||
win.setTimeout(stub1, 500) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just thought of a better approach here...
Instead of hoping the webserver sends us back the response in 500ms, we could instead use cypress events to wait for the window:unload
event, gauranteeing this has happened.
At that point we could then set the setTimeout
and then assert its not called after waiting.
Released in |
culprit 1
driver/src/cy/timers does not fire queued timers if page transitions while paused
estimated failure rate: 8%
example
https://circleci.com/gh/cypress-io/cypress/54032#tests/containers/1
fix
upping the timeout here seems to fix it
culprit 2
src/cy/commands/xhr abort does not set aborted on XHR's that have completed by have had .abort() called
estimated failure rate: 5%
example
https://circleci.com/gh/cypress-io/cypress/54474#tests/containers/1
fix
apparently a
.should
chained off a.then
will not retry.so I used
cy.wrap(null).should