fix(test): eliminate flaky test isolation issues#3312
Closed
OneStepAt4time wants to merge 0 commit into
Closed
Conversation
Contributor
There was a problem hiding this comment.
β Approved. Clean fix for two root causes of CI flakiness:
- vitest.config.ts β
wt-*/**exclusion prevents worktree test discovery causingdocument is not definederrors and temp file collisions. Correct addition. - fix-2534 test β
crypto.randomUUID()eliminates temp file collisions under parallel execution. AwaitingsweepStaleRateLimits()instead of fire-and-forget +setTimeout(10)removes the async race withafterEachcleanup.
All CI green, targets develop, minimal diff, no secrets. Verified 10/10 green in PR description.
c2cb3db to
5b8451e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two root causes of CI flakiness.
1. vitest.config.ts β worktree test discovery
Root config excluded
dashboard/**but NOTwt-*/**. Dashboard tests in worktrees ran in Node env instead of jsdom β"document is not defined". Also caused AuthManager test temp file collisions under parallel execution.Fix: Added
wt-*/**to exclude array.2. fix-2534 test β temp file collision + async race
Date.now()temp file names collide under parallel executionsweepStaleRateLimits()called fire-and-forget +setTimeout(10)β races withafterEachcleanupFix:
crypto.randomUUID()for file names + properawait.Verified: 10/10 runs green (was 4/5 before).
Verification