Skip to content

test(layout): load the runtime graph once before the layout capability tests - #33923

Merged
nwparker merged 1 commit into
mainfrom
nwparker/layout-test-warm-import
Oct 26, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/layout-test-warm-import

Conversation

@nwparker

@nwparker nwparker commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​7 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6
Prod 0 0 0 0

ELI5

The first test in workspace-layout-paired-desktop.test.ts has to load the whole runtime cold, inside its 30 s limit. On a slow CI shard that load takes longer than 30 s, and the test times out even though nothing is wrong. Now the file does that load once, before its tests start.

What Changed

  • New beforeAll: it runs switchedBuild(true) once, with a 120 s budget. The hook has a short comment saying why.
  • Before: the first test, "is advertised only by a layout-owner build", paid the first transform of orca-runtime, the dispatcher and the methods index inside its own 30 s budget.
  • After: that cost lands in the hook. Later switchedBuild calls still vi.resetModules() and re-evaluate each build, but they reuse the transforms; in CI those tests already take about 1.5–2.5 s each. Assertions are unchanged.

Why

#33897 failed this test three times in shard 1/5 (runs 40307544019, its rerun, and 40316052149). Meanwhile #33907 passed it with 22.4 s of its 30 s used.

Why it tipped over only on #33897: CI places test files into shards by weighted timing. #33897 adds a new test file with no timing history, which reshuffled shard 1. I compared the file lists of the two shard-1 runs: about 1040 of roughly 2650 files differ. The new file itself is not in shard 1 and doesn't import the runtime.

So the change is in this file's neighbors, not in what it loads. That points at a cold-import margin of a few seconds, which any reshuffle can push past 30 s.

Raising the test timeout alone would hide future slowdowns of the test itself. Loading once in a hook keeps each test's 30 s budget meaningful.

Linked Issue

Unblocks #33897.

Visual Proof

N/A: test-only change.

Testing

  • pnpm tc and pnpm run check:code-quality:changed pass.

  • Locally the file can't finish at the Mac's current load (average around 80). Every switchedBuild exceeds its budget on this machine both with and without this change, so CI is the check here.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Test-only change: no product, SSH or wire impact.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…y tests

The first test paid the cold transform of the whole runtime graph inside its
30 s budget and timed out whenever a shard placed it without warm neighbors.
@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 3 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d9dccbf4-7760-4e53-9380-a26ec981849f
Commits

Reviewing files that changed from the base of the PR and between 1ac1d40 and a89f701.

Files selected for processing: 1
  • src/main/runtime/rpc/methods/workspace-layout-paired-desktop.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit f3059dd into main Oct 26, 2026
32 checks passed
nwparker added a commit that referenced this pull request Oct 26, 2026
#33919 and #33923 both fixed this file's cold-import timeout and crossed: #33923's beforeAll calls switchedBuild, which #33919 replaced with static imports. Main fails typecheck (TS2304). The static imports already pay the transform once.
nwparker added a commit that referenced this pull request Oct 26, 2026
…3934)

#33919 and #33923 both fixed this file's cold-import timeout and crossed: #33923's beforeAll calls switchedBuild, which #33919 replaced with static imports. Main fails typecheck (TS2304). The static imports already pay the transform once.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant