Repository navigation
test(dashboard): load credential test modules before timed tests - #4364
Open
ScriptedAlchemy wants to merge 1 commit into
Open
ScriptedAlchemy wants to merge 1 commit into
ScriptedAlchemy wants to merge 1 commit into
Conversation
|
ScriptedAlchemy
marked this pull request as ready for review
October 19, 2026 07:02
The credential tests reset modules and then imported credential.ts and responseBody.ts inside the test body. The first import of each module waits on the Vite server in the main process. On a loaded host that wait exceeded the 5 s test timeout. Static imports now load both modules during collection, so the re-import after vi.resetModules() uses cached code. Part of #4331. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ScriptedAlchemy
force-pushed
the
test/4331-credential-transport-determinism
branch
from
October 20, 2026 09:43
21e0b49 to
10898af
Compare
This branch has not been deployed
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.
Part of #4331; #4334 covers the event-source test.
Why
The credential tests call
vi.resetModules()and then importcredential.tsandresponseBody.tsinside the test body. The first import of a module fetches it from the Vite server in the vitest main process. On a loaded host, that fetch waits for the main process and can exceed the 5 s test timeout. The test has no timers, and the request itself takes about 1 ms.What changed
credential.dom.test.tsimports both modules at the top of the file. Vitest loads them during collection, which has no per-test timeout. The re-import aftervi.resetModules()then evaluates cached code and makes no server request.Scope
vi.resetModules()and every assertion.dashboard/BUILD.bazel, orMODULE.bazel. test(dashboard): bound Bazel workers and isolate auth streams #4334 owns those.Blast Radius
Test-only. The two new imports have no side effects, because neither module runs code at import time.
Verification
dashboardFetchwithfetchinfetchJsonResponse. The transport case fails in 4 ms withexpected null to be 'Basic ...'.pnpm teston the committed head passed twice (221 files, 2137 tests). The 1-minute load average went from 15.8 to 41.9 in the first run and from 38.9 to 73.4 in the second, on 12 cores. The transport case took 14 ms.🤖 Generated with Claude Code