test(e2e): silence timing-dependent Vite logs in vitest browser fixture - #762
Merged
Merged
Conversation
fspy benchmarklinuxmacoswindows |
Vite's dependency optimizer prints "[optimizer] scanning dependencies..." and "[optimizer] bundling dependencies..." when those phases exceed 1s, which occasionally happens on macOS x64 CI runners and breaks the vitest_browser_cache snapshot. Vitest browser mode hard-codes the browser server's log level to VITEST_BROWSER_DEBUG ?? "info"; "false" is the only value that silences that logger without enabling browser-side debug output. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
wan9chi
force-pushed
the
test/vitest-browser-silence-optimizer-logs
branch
from
September 27, 2026 13:20
d1fbdea to
a5e5046
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.
Motivation
vitest_browser_cachefails every so often on macOS x64 CI because an extra line shows up in the snapshot:Recent failures: 36318877151 (attempt 1), 36087090263, 36084775576, 36084774143, 31664423600.
Vite's dependency optimizer prints
[optimizer] scanning dependencies...if the scan takes longer than 1s, and[optimizer] bundling dependencies...if bundling does. Both depend on how fast the runner is.Change
Run the fixture's task as
VITEST_BROWSER_DEBUG=false vitest run.Vitest browser mode hard-codes the browser server's Vite log level to
process.env.VITEST_BROWSER_DEBUG ?? "info", sologLevelin the config has no effect."false"is the only value that silences that logger without also turning on the browser-side debug output. Any other non-empty value,warnincluded, turns on client debug RPC logs that contain session IDs, ports and timings.I forced both timers to fire with artificially slow plugins. Without the variable, both messages were printed; with it, neither was. The test result line and the JSON report output were unaffected.