Skip to content

test(web): stop MessagesTimeline tests silently skipping under load - #118

Merged
incognitojam merged 1 commit into
mainfrom
t3code/fix-timeline-test-hook-timeout
Aug 13, 2026
Merged

test(web): stop MessagesTimeline tests silently skipping under load#118
incognitojam merged 1 commit into
mainfrom
t3code/fix-timeline-test-hook-timeout

Conversation

@incognitojam

Copy link
Copy Markdown
Collaborator

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:

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).

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.
@github-actions github-actions Bot added size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Aug 13, 2026
@incognitojam
incognitojam merged commit 91bc548 into main Aug 13, 2026
10 checks passed
@incognitojam
incognitojam deleted the t3code/fix-timeline-test-hook-timeout branch August 13, 2026 13:19
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant