Skip to content

test: give the fixture test of the debug mesh a longer time limit - #3497

Merged
timohueser merged 1 commit into
ground-planfrom
claude/debug-test-timeout
Nov 15, 2026
Merged

timohueser merged 1 commit into
ground-planfrom
claude/debug-test-timeout

Conversation

@timohueser

@timohueser timohueser commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

What

plan/debug.test.ts > fills each face of real fixture cells to its own area gets a time limit of 30 s.

Why

The test builds three real fixture cells and meshes each face alone. On the owner PC it takes 2.5 to 3.5 s. In the CI run of #3491 (the merge of ground-plan into develop) it timed out at vitest's default limit of 5 s; all other 1,770 tests passed. The test does the same work as before: the limit was too near its normal time.

The limit of 30 s is chosen with a wide margin for a busy runner; it is not a measured budget.

Checks

  • npx vitest run src/lib/trailview/plan/debug.test.ts (through obc exec): 3 of 3 pass.
  • Not run: other suites. The change is one test's time limit.

Public docs do not change.

Mode: change #3096
Requirements: none

🤖 Generated with Claude Code

The test builds three real fixture cells and meshes each face alone. It takes
several seconds, and it timed out at the default limit of 5 s in a CI run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 16f491c7-598a-41e4-be06-7498d30b235f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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

@timohueser

Copy link
Copy Markdown
Owner Author

Review of #3497: a longer time limit for the fixture test of the debug mesh

Verdict: MERGE WITH NOTES

The change is correct and is the smallest fix. The failure in CI was a busy runner, not a slower test.
The notes are small and do not block the merge.

Findings, by weight

1. The time-out is runner load, not a slowdown (strongest evidence)

2. Where the time goes (measured on timosPC, at 8a399ce)

Three plain runs of debug.test.ts, each under systemd-run --user --scope -p MemoryMax=3G -p MemorySwapMax=0 nice obc exec npx vitest run ... --reporter=verbose:

Run The fixture test The file (tests)
1 2,428 ms 2.61 s
2 2,517 ms 2.73 s
3 2,567 ms 2.78 s

The PR body says "about 3.5 s on the owner PC". Alone, I measured 2.4–2.6 s; beside the other plan
test files, 2.9 s. The PR figure is high but in the same range. It is not wrong in a way that matters.

One more run with timers put into the test for a moment (file restored with git checkout; the
worktree is clean). Total 2,930 ms:

Cell Build Mesh of the whole cell Faces checked Mesh of each face alone earcut and sums
34303-23102 272 ms 438 ms 61 322 ms 32 ms
34298-23099 222 ms 372 ms 221 437 ms 41 ms
34297-23099 137 ms 260 ms 158 367 ms 24 ms
Sum 631 ms (22 %) 1,070 ms (37 %) 440 1,126 ms (38 %) 97 ms

The time is in the TypeScript debug mesh (debug.ts, Mesh.fill), about three quarters, and it
is done twice: once for the whole cell and once face by face. The three cell builds in WASM are
about a fifth. No single face is slow: the largest face takes 71 ms.

3. History: nothing on the hot path changed recently

  • debug.ts: last change 2026-11-05 (381d3ed, the trapezoid fills). The fill code is the same
    since then.
  • debug.test.ts: last change 2026-11-10 (e4b972b, the bridge takes the request into build).
    This changed the call, not the work.
  • builder/ground-plan-wasm and host/obc-ground-plan: many changes on 2026-11-13 to 11-15
    (storeys, decks, tunnel rules). The fixture tiles were rebaked on 11-13 and 11-15. These can change
    the build time and the count of faces. The build is only a fifth of the test, and the test passed
    in CI on ground plan GP12.4 step 1: tunnel rules A and B in the bake's levels (no pixel change) #3488 with all of these changes in.
  • Not measured: the test's time at older commits. I did not build older bridges (the brief forbids
    it). So I cannot give a number for "before". Finding 1 shows that the code at the head passes in
    CI on a normal runner.

4. The diff and the comment

  • gh pr diff 3497: one file, builder/web/src/lib/trailview/plan/debug.test.ts, +2 −1. It adds
    one comment line and changes }); to }, 30_000); on the fixture test. Nothing else. This is what
    the description says.
  • The comment "Three real cells, each face meshed alone: a busy runner takes longer than the default
    limit." gives a non-obvious reason. It has no date, issue number or measurement. It follows
    AGENTS.md.
  • 30 s is the value that seven other TrailView tests already use (roads/mesh.test.ts twice,
    roads/decks.test.ts, terrain/node-bytes.test.ts, terrain/stamp-sources.test.ts,
    terrain/bins.test.ts, models/trees.test.ts). The PR follows the convention.
  • Note (style, not blocking): the comment stands at the end of the test body, just above
    }, 30_000);. It reads correctly there. roads/decks.test.ts puts its comment above the block
    instead; either is fine.

5. Is there an equally small change that makes the test cheap?

  • Fewer cells: one cell less saves about a third. But the comment says that the cells were picked
    for holes, bends and shoulders around grid squares. Removing one loses a chosen case. Not
    recommended.
  • One mesh pass instead of two: the call debugMesh(all, ...) for the whole cell is 37 % of the
    time. With empty edges and ways, its unfilled is the sum of the per-face unfilled counts. A
    per-face loop over every filled face (also the faces that are not whole in the square), with
    expect(mesh.unfilled).toBe(0) on each, proves the same thing with one pass. This saves about
    1 s (2.9 s to about 1.9 s). It is a change of a few lines, not one, and the test still needs a
    margin on a busy runner.
  • Recommendation: merge the time limit as it is. The proof stays whole, and the cost is the same
    as before. The one-pass rewrite is an optional later cleanup; it is not needed for this fix.

6. Other tests in plan/ near the limit

One verbose run of all four test files in builder/web/src/lib/trailview/plan/ (capped, as
above). 14 tests passed, 5.41 s in total. No other test is within a factor of two of 5 s
(that is, over 2.5 s):

Test Time
debug.test.ts > fills each face of real fixture cells to its own area 2,936 ms
mesh.test.ts > reads the storeys after a cell mesh ... 409 ms
mesh.test.ts > reads a real cell ... 367 ms
plan.test.ts > the bridge > names pages of levels 13 and 14, and builds a cell ... 351 ms
debug.test.ts > fills a face with its holes and a long strip ... 266 ms
all others 81 ms or less

Only the test of this PR is at risk. No other plan/ test needs a longer limit.

What I ran and what I left out

Ran:

Left out:

  • The raw CI log (forbidden), so the per-test time in CI is not known to me.
  • Times at older commits (no older bridges built).
  • The whole trailview vitest folder, other suites, npm run check.
  • I made no separate worktree under review-3497/: the prepared worktree had all I needed, and I
    changed nothing in it that stayed.

Orchestrator: no code change follows from the review, so there is no delta review. The description now says 2.5 to 3.5 s. The one-pass rewrite of the test (finding 6) is optional and is not done here.

Generated by Claude Code

@timohueser
timohueser merged commit 8f49aaf into ground-plan Nov 15, 2026
24 checks passed
@timohueser
timohueser deleted the claude/debug-test-timeout branch November 15, 2026 14:20
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