-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
ci: retry flaky tests #9508
ci: retry flaky tests #9508
Conversation
related #9492
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.
This looks great! 💚
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.
Looks great @tony19! I think this is a good idea, at least for the node segfault we can't use something from Vitest side (even if there is a retry mechanism). @antfu @sheremet-va looping you to see if this is a good approach (at least for the moment) for the Vite repo, as I think other projects may end up copying what we do here.
@dominikg maybe we should do the same on Vite ecosystem CI?
not a fan of a bash script wrapper in general
other remarks
|
@dominikg Thanks for the feedback! I did actually experiment with a Node/ I also agree with pushing for an upstream fix, but it doesn't look like the Node team is anywhere close to a fix, and they're not sure the fix is even feasible:
For the time being, an automated retry seems like a reasonable workaround to keep the bots going without babysitting them. I'm completely open to other ideas though! Update: Fix for Node 16 identified here |
Looks great! A side note, I guess it might be good to create a CLI wrapper like |
Sure, something like |
Yeah |
@antfu @sheremet-va Yes, please! 😄 A native |
A flag on vitest bin makes it reusable which is great! Not sure how i feel about it being enabled by default, tbh i havn't seen this segfault happening in vite-plugin-svelte suite (which is a bit smaller but uses the same setup as vite). It should be something users conciously opt-in to, so as they are aware of it. If it is enabled and can detect github action event to log the warning card, that would be awesome. |
Node published a v16 fix in |
related #9492
Description
This updates the CI test jobs to use
retry.ts
, which reruns the given command (up to 3 times by default) if its output contains one of the errors indicated in #9492. I picked 3 for the default retry count because in my experiments, the same error can appear twice in a row.The script also adds a warning annotation to the GitHub workflow run to easily identify the flakiness from the Summary view:
This script can be run locally like this:
Testing
retry.ts
Here's a script that runs
pnpm --color=always test-build
10 times in a row, which causes one of the known errors in Node 16:(Tested on macOS Big Sur with Node 16.16.0)
Screenshot:
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).