test(web): stop MessagesTimeline tests silently skipping under load - #118
Merged
Conversation
The file deferred `await import("./MessagesTimeline")` into a beforeAll with
a 30s timeout so the DOM globals could be stubbed first. In isolation the file
runs in 3s, but under full-suite contention the hook hit that timeout and the
file reported `18 tests | 18 skipped` without failing, so CI stayed green while
losing all 18 tests.
Move the stubs into vi.hoisted, which runs ahead of imports, so the module can
be imported statically and no hook timeout wraps the module graph.
yngatech-nightly Bot
pushed a commit
that referenced
this pull request
Aug 13, 2026
…118) ## Problem `MessagesTimeline.test.tsx` needs DOM globals stubbed before its module graph is evaluated, because the web `unit` project runs on the **node** environment. It did that by deferring the import into a hook: ```ts let MessagesTimeline: typeof import("./MessagesTimeline").MessagesTimeline; beforeAll(async () => { vi.stubGlobal("window", { /* ... */ }); ({ MessagesTimeline } = await import("./MessagesTimeline")); }, 30_000); ``` That puts the module graph's transform cost *inside a hook timeout*. Run alone the file takes 3s, but under full-suite contention the hook hit its 30s timeout and the file reported `18 tests | 18 skipped` at 30100ms — **without failing**. CI stayed green having run 18 fewer tests than it appeared to. This is pre-existing, but #112 moved Fork Test to a 4-core free runner, which makes the contention that triggers it more likely. ## Fix Move the stubs into `vi.hoisted`, which runs ahead of imports, so `MessagesTimeline` is imported statically and no hook timeout wraps the module graph. This removes the failure mode structurally rather than by raising the timeout. `vi.hoisted` is already the idiom in ~10 other web test files. ## Verification - File alone: 18/18 pass. - Timing confirms the cost moved out of the hook phase: `tests 2.62s / import 619ms` before, `tests 98ms / import 2.16s` after. No hook timeout applies to the import phase. - Full `@t3tools/web` suite: 250 files / 2451 tests, **0 skipped**, exit 0. Previously this run showed MessagesTimeline at `18 tests | 18 skipped`. - `@t3tools/web` typecheck clean. Worth noting the original stall was intermittent (1 of 2 full runs), so a green run is not by itself proof. The argument for the fix is structural: there is no longer a timed hook around the import. --- Written by an agent (Claude Code, claude-opus-5).
yngatech-nightly Bot
pushed a commit
that referenced
this pull request
Aug 13, 2026
…118) ## Problem `MessagesTimeline.test.tsx` needs DOM globals stubbed before its module graph is evaluated, because the web `unit` project runs on the **node** environment. It did that by deferring the import into a hook: ```ts let MessagesTimeline: typeof import("./MessagesTimeline").MessagesTimeline; beforeAll(async () => { vi.stubGlobal("window", { /* ... */ }); ({ MessagesTimeline } = await import("./MessagesTimeline")); }, 30_000); ``` That puts the module graph's transform cost *inside a hook timeout*. Run alone the file takes 3s, but under full-suite contention the hook hit its 30s timeout and the file reported `18 tests | 18 skipped` at 30100ms — **without failing**. CI stayed green having run 18 fewer tests than it appeared to. This is pre-existing, but #112 moved Fork Test to a 4-core free runner, which makes the contention that triggers it more likely. ## Fix Move the stubs into `vi.hoisted`, which runs ahead of imports, so `MessagesTimeline` is imported statically and no hook timeout wraps the module graph. This removes the failure mode structurally rather than by raising the timeout. `vi.hoisted` is already the idiom in ~10 other web test files. ## Verification - File alone: 18/18 pass. - Timing confirms the cost moved out of the hook phase: `tests 2.62s / import 619ms` before, `tests 98ms / import 2.16s` after. No hook timeout applies to the import phase. - Full `@t3tools/web` suite: 250 files / 2451 tests, **0 skipped**, exit 0. Previously this run showed MessagesTimeline at `18 tests | 18 skipped`. - `@t3tools/web` typecheck clean. Worth noting the original stall was intermittent (1 of 2 full runs), so a green run is not by itself proof. The argument for the fix is structural: there is no longer a timed hook around the import. --- Written by an agent (Claude Code, claude-opus-5).
yngatech-nightly Bot
pushed a commit
that referenced
this pull request
Aug 14, 2026
…118) ## Problem `MessagesTimeline.test.tsx` needs DOM globals stubbed before its module graph is evaluated, because the web `unit` project runs on the **node** environment. It did that by deferring the import into a hook: ```ts let MessagesTimeline: typeof import("./MessagesTimeline").MessagesTimeline; beforeAll(async () => { vi.stubGlobal("window", { /* ... */ }); ({ MessagesTimeline } = await import("./MessagesTimeline")); }, 30_000); ``` That puts the module graph's transform cost *inside a hook timeout*. Run alone the file takes 3s, but under full-suite contention the hook hit its 30s timeout and the file reported `18 tests | 18 skipped` at 30100ms — **without failing**. CI stayed green having run 18 fewer tests than it appeared to. This is pre-existing, but #112 moved Fork Test to a 4-core free runner, which makes the contention that triggers it more likely. ## Fix Move the stubs into `vi.hoisted`, which runs ahead of imports, so `MessagesTimeline` is imported statically and no hook timeout wraps the module graph. This removes the failure mode structurally rather than by raising the timeout. `vi.hoisted` is already the idiom in ~10 other web test files. ## Verification - File alone: 18/18 pass. - Timing confirms the cost moved out of the hook phase: `tests 2.62s / import 619ms` before, `tests 98ms / import 2.16s` after. No hook timeout applies to the import phase. - Full `@t3tools/web` suite: 250 files / 2451 tests, **0 skipped**, exit 0. Previously this run showed MessagesTimeline at `18 tests | 18 skipped`. - `@t3tools/web` typecheck clean. Worth noting the original stall was intermittent (1 of 2 full runs), so a green run is not by itself proof. The argument for the fix is structural: there is no longer a timed hook around the import. --- Written by an agent (Claude Code, claude-opus-5).
yngatech-nightly Bot
pushed a commit
that referenced
this pull request
Aug 14, 2026
…118) ## Problem `MessagesTimeline.test.tsx` needs DOM globals stubbed before its module graph is evaluated, because the web `unit` project runs on the **node** environment. It did that by deferring the import into a hook: ```ts let MessagesTimeline: typeof import("./MessagesTimeline").MessagesTimeline; beforeAll(async () => { vi.stubGlobal("window", { /* ... */ }); ({ MessagesTimeline } = await import("./MessagesTimeline")); }, 30_000); ``` That puts the module graph's transform cost *inside a hook timeout*. Run alone the file takes 3s, but under full-suite contention the hook hit its 30s timeout and the file reported `18 tests | 18 skipped` at 30100ms — **without failing**. CI stayed green having run 18 fewer tests than it appeared to. This is pre-existing, but #112 moved Fork Test to a 4-core free runner, which makes the contention that triggers it more likely. ## Fix Move the stubs into `vi.hoisted`, which runs ahead of imports, so `MessagesTimeline` is imported statically and no hook timeout wraps the module graph. This removes the failure mode structurally rather than by raising the timeout. `vi.hoisted` is already the idiom in ~10 other web test files. ## Verification - File alone: 18/18 pass. - Timing confirms the cost moved out of the hook phase: `tests 2.62s / import 619ms` before, `tests 98ms / import 2.16s` after. No hook timeout applies to the import phase. - Full `@t3tools/web` suite: 250 files / 2451 tests, **0 skipped**, exit 0. Previously this run showed MessagesTimeline at `18 tests | 18 skipped`. - `@t3tools/web` typecheck clean. Worth noting the original stall was intermittent (1 of 2 full runs), so a green run is not by itself proof. The argument for the fix is structural: there is no longer a timed hook around the import. --- Written by an agent (Claude Code, claude-opus-5).
incognitojam
added a commit
that referenced
this pull request
Aug 15, 2026
…118) ## Problem `MessagesTimeline.test.tsx` needs DOM globals stubbed before its module graph is evaluated, because the web `unit` project runs on the **node** environment. It did that by deferring the import into a hook: ```ts let MessagesTimeline: typeof import("./MessagesTimeline").MessagesTimeline; beforeAll(async () => { vi.stubGlobal("window", { /* ... */ }); ({ MessagesTimeline } = await import("./MessagesTimeline")); }, 30_000); ``` That puts the module graph's transform cost *inside a hook timeout*. Run alone the file takes 3s, but under full-suite contention the hook hit its 30s timeout and the file reported `18 tests | 18 skipped` at 30100ms — **without failing**. CI stayed green having run 18 fewer tests than it appeared to. This is pre-existing, but #112 moved Fork Test to a 4-core free runner, which makes the contention that triggers it more likely. ## Fix Move the stubs into `vi.hoisted`, which runs ahead of imports, so `MessagesTimeline` is imported statically and no hook timeout wraps the module graph. This removes the failure mode structurally rather than by raising the timeout. `vi.hoisted` is already the idiom in ~10 other web test files. ## Verification - File alone: 18/18 pass. - Timing confirms the cost moved out of the hook phase: `tests 2.62s / import 619ms` before, `tests 98ms / import 2.16s` after. No hook timeout applies to the import phase. - Full `@t3tools/web` suite: 250 files / 2451 tests, **0 skipped**, exit 0. Previously this run showed MessagesTimeline at `18 tests | 18 skipped`. - `@t3tools/web` typecheck clean. Worth noting the original stall was intermittent (1 of 2 full runs), so a green run is not by itself proof. The argument for the fix is structural: there is no longer a timed hook around the import. --- Written by an agent (Claude Code, claude-opus-5).
yngatech-nightly Bot
pushed a commit
that referenced
this pull request
Aug 18, 2026
…118) `MessagesTimeline.test.tsx` needs DOM globals stubbed before its module graph is evaluated, because the web `unit` project runs on the **node** environment. It did that by deferring the import into a hook: ```ts let MessagesTimeline: typeof import("./MessagesTimeline").MessagesTimeline; beforeAll(async () => { vi.stubGlobal("window", { /* ... */ }); ({ MessagesTimeline } = await import("./MessagesTimeline")); }, 30_000); ``` That puts the module graph's transform cost *inside a hook timeout*. Run alone the file takes 3s, but under full-suite contention the hook hit its 30s timeout and the file reported `18 tests | 18 skipped` at 30100ms — **without failing**. CI stayed green having run 18 fewer tests than it appeared to. This is pre-existing, but #112 moved Fork Test to a 4-core free runner, which makes the contention that triggers it more likely. Move the stubs into `vi.hoisted`, which runs ahead of imports, so `MessagesTimeline` is imported statically and no hook timeout wraps the module graph. This removes the failure mode structurally rather than by raising the timeout. `vi.hoisted` is already the idiom in ~10 other web test files. - File alone: 18/18 pass. - Timing confirms the cost moved out of the hook phase: `tests 2.62s / import 619ms` before, `tests 98ms / import 2.16s` after. No hook timeout applies to the import phase. - Full `@t3tools/web` suite: 250 files / 2451 tests, **0 skipped**, exit 0. Previously this run showed MessagesTimeline at `18 tests | 18 skipped`. - `@t3tools/web` typecheck clean. Worth noting the original stall was intermittent (1 of 2 full runs), so a green run is not by itself proof. The argument for the fix is structural: there is no longer a timed hook around the import. --- Written by an agent (Claude Code, claude-opus-5).
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.
Problem
MessagesTimeline.test.tsxneeds DOM globals stubbed before its module graph isevaluated, because the web
unitproject runs on the node environment. Itdid that by deferring the import into a hook:
That puts the module graph's transform cost inside a hook timeout. Run alone
the file takes 3s, but under full-suite contention the hook hit its 30s timeout
and the file reported
18 tests | 18 skippedat 30100ms — without failing.CI stayed green having run 18 fewer tests than it appeared to.
This is pre-existing, but #112 moved Fork Test to a 4-core free runner, which
makes the contention that triggers it more likely.
Fix
Move the stubs into
vi.hoisted, which runs ahead of imports, soMessagesTimelineis imported statically and no hook timeout wraps the modulegraph. This removes the failure mode structurally rather than by raising the
timeout.
vi.hoistedis already the idiom in ~10 other web test files.Verification
tests 2.62s / import 619msbefore,tests 98ms / import 2.16safter. No hook timeoutapplies to the import phase.
@t3tools/websuite: 250 files / 2451 tests, 0 skipped, exit 0.Previously this run showed MessagesTimeline at
18 tests | 18 skipped.@t3tools/webtypecheck clean.Worth noting the original stall was intermittent (1 of 2 full runs), so a green
run is not by itself proof. The argument for the fix is structural: there is no
longer a timed hook around the import.
Written by an agent (Claude Code, claude-opus-5).