Skip to content

test(octane): give the behavior-root DOM attach matrix a 60 s timeout - #2286

Merged
trueadm merged 1 commit into
mainfrom
test/behavior-root-compile-timeout
Oct 29, 2026
Merged

trueadm merged 1 commit into
mainfrom
test/behavior-root-compile-timeout

Conversation

@jonkwheeler

@jonkwheeler jonkwheeler commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes a flaky test: behavior-root.test.ts › "attaches to existing DOM without replacing nodes or mutating protected attributes". The test runs too close to its 15 s limit, so a slow runner times it out. This PR raises the limit to 60 s, which other compile-heavy tests already use.

Why

CI timed this test out (Error: Test timed out in 15000ms.) on two unrelated branches:

date branch run
2026-10-14 perf/hydration-settlement-2028 38591913392
2026-10-28 fix/skip-hidden-module-retries 40668023429, attempt 1 (passed on rerun)

In the 2026-10-28 run, the abandoned test body kept running after the timeout. It then threw TypeError: Cannot read properties of undefined (reading 'render') from a later test, at hydratedRoot!.render(...) inside startTransition, because that test had already reset the shared hydratedRoot.

The test is slow because it compiles hundreds of fixtures, not because the runtime got slower. I timed loadCompiledFixtureSource during one run in octane-prod: 582 compiles took 9.24 s of the test's 11.97 s, and evaluating the compiled fixtures took 0.19 s. On the same machine the whole test took 12.4 s (dev) and 13.2 s (prod) at a load average of 30–60, and 5.5 s and 8.9 s at a load average of 13. The 15 s limit came with #1069 (2026-09-16), when the test ended at about line 1,927. It now ends at line 5,038.

Changes

  • packages/octane/tests/behavior-root.test.ts: the test's timeout goes from 15_000 to 60_000, and the existing comment says why.

Validation

  • pnpm format:check (not run; pnpm format:files:check on the changed file is clean)
  • pnpm typecheck (not run; the change is a numeric literal and a comment)
  • pnpm test (not run; the local machine is too loaded for the full suite)
  • targeted tests: vitest run --project octane --project octane-prod packages/octane/tests/behavior-root.test.ts passes (774 tests).
  • pnpm sync leaves the tree clean.

Risk / follow-ups

  • Test-only. A real hang in this test now takes up to 60 s to report instead of 15 s.
  • Splitting the matrix into smaller tests, or caching identical fixture compiles in _server-fixture.ts, would cut its run time. Both change shared test structure, so they're left for the maintainers.

Provenance

  • An agent produced this diff (agent-authored)

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Note

Low Risk
Test-only timeout and comment change; no production or runtime behavior is affected.

Overview
Raises the Vitest timeout for "attaches to existing DOM without replacing nodes or mutating protected attributes" from 15 s to 60 s in behavior-root.test.ts.

The test’s dev/prod matrix compiles hundreds of fixtures (~582 compiles can take ~9 s alone), so busy CI runners were hitting the old limit and failing flaky timeouts; the comment now documents that timing rationale. Aligns with other compile-heavy Octane tests that already use 60 s.

Reviewed by Cursor Bugbot for commit 4bfdfbf. Bugbot is set up for automated code reviews on this repo. Configure here.

"attaches to existing DOM without replacing nodes or mutating protected
attributes" compiles 582 fixture modules across its dev/prod matrix. On a
busy machine the compiles take about 9 s of a 12 s run, and a quiet one
still takes 5.5–9 s. Its 15 s limit dates from #1069, when the test was
about a third of its current length. CI timed it out on 2026-10-14 and
2026-10-28, and the abandoned body then threw from a later test's shared
hydratedRoot.

Use the 60 s budget other compile-heavy tests use.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jonkwheeler
jonkwheeler marked this pull request as ready for review October 29, 2026 11:07
@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent test PR: tests only labels Oct 29, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
octane-website 4bfdfbf Commit Preview URL

Branch Preview URL
Oct 29 2026, 11:10 AM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
octane-website-mcp 4bfdfbf Commit Preview URL

Branch Preview URL
Oct 29 2026, 11:08 AM

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark report

🟢 No byte growth, no added work, and no timing changes beyond ±3%.

Compares 3f3bf1ab7, the merge commit's first parent with f47bef588 on the same runner. Any increase in a js-framework work counter fails this check; byte changes are a report. Wall time is a report: base and head samples alternate in one browser, and an operation is called slower or faster only when the 95% confidence interval of its ratio excludes ±3%. Workflow run

js-framework: 1k/10k row operations

All 20 timed operations (20 without a verdict)
target operation base ms head ms head/base 95% CI
octane-tsrx run 2.892 2.800 −1.6% −4.9% … +3.4% ⚪ within noise
octane-tsrx replace 6.517 6.550 −3.3% −10.2% … +2.4% ⚪ within noise
octane-tsrx add 2.433 2.358 −3.8% −4.2% … ±0.0% ⚪ within noise
octane-tsrx update 0.082 0.079 −0.3% −1.8% … +1.6% ⚪ within noise
octane-tsrx select 0.006 0.006 ±0.0% −1.2% … +1.2% ⚪ within noise
octane-tsrx swap 0.019 0.019 +0.9% −0.6% … +2.9% ⚪ within noise
octane-tsrx remove 0.016 0.016 +2.4% −1.5% … +4.4% ⚪ within noise
octane-tsrx runlots 24.767 23.675 +1.2% −3.7% … +7.0% ⚪ within noise
octane-tsrx select_lots 0.007 0.007 ±0.0% −1.2% … +2.5% ⚪ within noise
octane-tsrx clear 50.408 49.300 +0.8% −2.1% … +2.3% ⚪ within noise
octane-jsx run 3.575 3.600 ±0.0% ±0.0% … +2.8% ⚪ within noise
octane-jsx replace 6.192 6.192 +5.6% +0.0% … +8.9% ⚪ within noise
octane-jsx add 3.350 3.200 −1.5% −4.6% … +3.1% ⚪ within noise
octane-jsx update 0.164 0.163 −0.8% −0.8% … ±0.0% ⚪ within noise
octane-jsx select 0.083 0.086 −0.5% −1.0% … ±0.0% ⚪ within noise
octane-jsx swap 0.131 0.135 −2.5% −3.2% … −1.3% ⚪ within noise
octane-jsx remove 0.118 0.122 −1.1% −1.6% … +0.3% ⚪ within noise
octane-jsx runlots 27.350 26.433 −4.6% −6.6% … −0.9% ⚪ within noise
octane-jsx select_lots 0.868 0.873 +1.0% −0.0% … +2.1% ⚪ within noise
octane-jsx clear 52.025 52.142 +2.1% −2.5% … +4.4% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

No changes across 111 measured values.

Public-import reachability bundles (bytes)

No changes across 141 measured values.

@trueadm
trueadm merged commit 42dbbd0 into main Oct 29, 2026
52 of 55 checks passed
@trueadm
trueadm deleted the test/behavior-root-compile-timeout branch October 29, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent test PR: tests only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants