test(snapshots): suppress racy optimizer logs in vitest_browser_mode - #2297
Merged
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
fengmk2
marked this pull request as ready for review
August 3, 2026 01:50
fengmk2
force-pushed
the
fix-vitest-browser-mode-flaky
branch
from
August 3, 2026 01:50
964fc78 to
5bd9804
Compare
wan9chi
approved these changes
Aug 3, 2026
fengmk2
force-pushed
the
fix-vitest-browser-mode-flaky
branch
2 times, most recently
from
August 3, 2026 03:57
9ec4642 to
dd26887
Compare
Vite's dep optimizer logs "[optimizer] bundling dependencies..." and "[optimizer] scanning dependencies..." on a 1s timer, so the lines only appear when a cold-cache run is slow enough, breaking the snapshot. Extend the fixture's known-logs filter to drop them. Claude-Session: https://claude.ai/code/session_01Q33nALG7fPwXJ3Ltp5DYku
fengmk2
force-pushed
the
fix-vitest-browser-mode-flaky
branch
from
August 3, 2026 05:00
dd26887 to
098a8dc
Compare
fengmk2
added a commit
that referenced
this pull request
Aug 3, 2026
…#2299) The `env_install_interrupt` PTY snapshot fails intermittently on Windows: ``` +**Exit code:** 1 -interrupted stale package exists +interrupted stale package removed ``` Example failure: https://github.com/voidzero-dev/vite-plus/actions/runs/30777846280/job/91576844864?pr=2297 `taskkill /T /F` terminates the process tree in unspecified order. When the postinstall child dies before `vp.exe`, vp observes the failed npm child and runs `cleanup_failed_install`, removing the partial install dir before taskkill reaches vp itself, so no stale dir is left for the check-stale step. Reproduced the mechanism on macOS by killing the postinstall child first and letting vp react: same diff as the CI failure. Fix: enumerate vp's direct children while the tree is parked in the postinstall sleep, kill `vp.exe` first so it cannot react, then `taskkill /T` each orphaned child (killing vp alone would leave the installer children running). The Unix path and the recorded snapshot are unchanged. Stacked on #2297.
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.
The
vitest_browser_modePTY snapshot fails intermittently with an extra line:Example failure: https://github.com/voidzero-dev/vite-plus/actions/runs/30750855536/job/91504582504?pr=2248
Vite's dep optimizer emits
[optimizer] bundling dependencies...(and its sibling[optimizer] scanning dependencies...) on a 1ssetTimeout(vite/src/node/optimizer/index.ts), so the line only appears when a cold-cache bundle takes longer than 1s on a slow runner. The fixture already suppresses known non-deterministic Vite logs through a logger patch; this extends that filter to drop[optimizer]progress lines. The environment logger looks upconfig.logger.infoat call time, so the patch intercepts these messages. The recorded snapshot is unchanged.