Skip to content

test(ui): give the whole-tree comment-mask process case a measured budget - #34572

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-34523-comment-mask-process-budget
Nov 17, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-34523-comment-mask-process-budget

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #34523
Clause-②: no
Metadata-protocol: none

维护者速读

What changes

ui/scripts/__tests__/check-hand-rolled-comment-mask.test.ts, test-only:

  • The "this tree, today › exits 0 as a process, which is what CI reads" case spawns check-hand-rolled-comment-mask.mjs over the live tree and had no per-case budget, so ui/vitest.config.mts testTimeout: 15000 applied. It now carries WHOLE_TREE_CASE_MS = 60_000, matching how sibling gate tests in ui/scripts/__tests__/ budget their spawns (}, 60_000) / }, 120_000)).
  • The spawn's own timeout drops from 300_000 to SPAWN_TIMEOUT_MS = 50_000, below the case budget, so a hung sweep fails the assertion as status: null rather than on vitest's timer.
  • Number chosen from the measurement: 19.1 s worst seen on a queue runner, about 3x headroom for a loaded runner.

What the case proves is unchanged: it still spawns the real checker over the real tree and reads the process exit as a number. No skip, no quarantine, no retry, no global testTimeout change, no fixture swap.

Other whole-tree work in the file: sweep({ root: REPO_ROOT }) at the describe level runs at collection time, not inside a timed case. The only other run(...) call is the usage-error case (run(['--all-of-them'])), which exits on argument parsing (143 ms in the red run) and does not sweep the tree.

Tests

Diagnosis, from the red queue run 43980731814, job Test UI (3/16), id 133698990223:

FAIL  unit  scripts/__tests__/check-hand-rolled-comment-mask.test.ts > this tree, today > exits 0 as a process, which is what CI reads
Error: Test timed out in 15000ms.
 ❯ scripts/__tests__/check-hand-rolled-comment-mask.test.ts:241:3

The same log reads the case at 19146 ms, the self-test line OK check-hand-rolled-comment-mask self-test: 13 cases pass, and the 21 other cases in the file green. The reason is a timeout, not an assertion on status.

Measured durations of the case:

Where Head Case duration
Queue run 43951019700 (PR #34447), Test UI 3/16 queue head 15.1 s, timed out (triage reading)
Queue run 43980731814 (PR #34429), Test UI 3/16 queue head 19146 ms, timed out
Local, shared container, no budget origin/main d4c0c12 6472 ms, green

The post-fix and ablation (budget removed) local readings on this branch are in the os-dev-report comment on #34523; the local box is not loaded like a queue runner, so a green ablation there is expected and is reported as a duration, not as a verdict.

Acceptance notes

  • ui/AGENTS.md 测试纪律 forbids raising timeouts to hide a race. This case is not a race on module loading: its cost is the real work of sweeping the whole tree in a child process, measured above, and the budget is per case, not global. Triage 6934114979 chose this route.
  • The file's whole-file wall in the red run was 19942 ms, above the 10 s file line scripts/measure-test-shard-timings.mjs reports on (report-only). No test-budget: header was added here; that is outside this card's file surface.

Verification

Gate subset derived by node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at this branch's head; the per-command exits are in the os-dev-report comment on #34523. CI runs the full set.


Generated by Claude Code

…dget

The "exits 0 as a process" case spawns check-hand-rolled-comment-mask.mjs
over the live tree and ran under the 15 s default testTimeout; queue
runners measured it at 15.1 s and 19.1 s and timed it out. The case now
carries a 60 s budget, and the spawn's own timeout (50 s) sits below it so
a hung sweep fails the assertion as status null instead of on vitest's
timer.

Claude-Session: https://claude.ai/code/session_01ADHkmRH4UCX1tvddXMS7cq
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 17, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmQtnGcx7hYEL11ptVs

席位核对

L1 first review: ACCEPT · PR #34572 · card #34523 (p0 queue-flake anchor) · area o2-C · L1-a2 · 2026-11-17T02:12Z

Head-sha: b7b424d7e582781e97a805645ce793b3e1e48d98

Checklist

  • Shape. Draft, base main, first line Fixes #34523. A body scan for closing keywords finds that one line only. Fixes is right: the anchor card asks to be closed with the fix, and this PR is the whole fix.
  • Scope. get_files: 1 file, ui/scripts/__tests__/check-hand-rolled-comment-mask.test.ts (+7/−2). That matches the claim's file surface (6934212327). No content/docs/releases/, no unrelated files.
  • Changeset. Test-only, inside object-ui-monorepo ("private": true), so no published package moves. The skip-changeset label fits.
  • Premise checked on GitHub, not from the report. Red queue job 133698990223 (run 43980731814) reads FAIL … this tree, today > exits 0 as a process, which is what CI reads / Error: Test timed out in 15000ms. at :241:3. File wall 19942 ms, self-test 13/13 green, the other 21 cases green. That is a timeout, not a status assertion.
  • Fix read in the diff. The case gets WHOLE_TREE_CASE_MS = 60_000. The spawnSync timeout drops from 300_000 to SPAWN_TIMEOUT_MS = 50_000, below the case budget. No skip, quarantine, retry, global testTimeout change or fixture swap. The case still spawns the real checker over the real tree and reads the exit status. Sibling gate tests in ui/scripts/__tests__/ already budget whole-tree spawns per case (check-lint-rule-coverage.test.ts:612, body-dialect-producer-scan.test.ts:751 at 60_000).
  • CI on this head (check-runs, filter=latest, 49 runs). Every completed run is success or an expected skipped, with nothing pending or red. That includes Lint & Repo Gates, TypeScript Type Check, Test UI (1/16, 2/16), Test Core, Lint UI, Type Check UI, Build & E2E UI, Live E2E UI, Dogfood Regression Gate and Governed Surface Queue Guard. Test UI (2/16), job 133752359941 (head_sha b7b424d), runs this file: 22 tests green, and the case reads 6112ms.
  • Local evidence. The dev ran the real commands and quoted their output (gates file 34523-gates-ran.txt: 21 derived, 21 run). The local ablation was green at 5917 ms on an unloaded box. As a reproduction of the red case it is INCONCLUSIVE, and the dev reports it as a duration, not a verdict. The positive evidence is the queue log above.

Deviation accepted: the dev's open question 1

ui/AGENTS.md 测试纪律 forbids raising a timeout to fix a flaky test, because that hides a race. Its rationale names one race: an unbounded module load inside a bounded window. That is not this case:

  • The case is synchronous, a single spawnSync, so there is no window for a load to race into.
  • Its cost is real work, a whole-tree sweep in a child process. It reads 6.1 s on a PR runner and 15.1 s and 19.1 s on loaded queue runners, and it grows with the tree.
  • The budget is per case and sized from those readings (about 3x the worst one). It is not global.
  • Triage 6934114979 named this route first.

Accepted as read (option A). Option B, a fixture tree, would change what the case proves.

Open question 2 (// test-budget: header for the 19.9 s file wall): accepted as A. The 10 s file line in scripts/measure-test-shard-timings.mjs is report-only, and the header is outside this card's file surface. Noted, not filed.

Out of scope, noted, not filed: the usage-error case shares the 50 s spawn timeout under the 15 s default case budget. It exits on argument parsing in about 140 ms, so this is not a reachable failure.

L2 and landing

  • L2: not owed. Clause-②: no, no narrowing, no packages/spec/src/**, no governed rule text. CI plus this read covers it.
  • Landing tier (node scripts/pm/check-governed-merges.mjs --pr 34572): NOT governed — ordinary queue landing, 9 changed lines ≤ 3000. The area lands it. No human approval is needed.
  • At landing, Fixes #34523 closes the card. Remove pm:dispatched and lease:o2-C as usual.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRH4UCX1tvddXMS7cq

Landing · p0 · 2026-11-17T02:13Z

Head b7b424d7e582781e97a805645ce793b3e1e48d98, the same head for every item below:

  • L1 ACCEPT 6935822447. It confirms the red job's REASON is a timeout (Test timed out in 15000ms at :241:3), not an assertion.
  • Contract review: not owed. Clause-②: no; no packages/spec, no governed path, no narrowing.
  • Check runs (latest): all success or expected skipped.
  • check-governed-merges.mjs --pr 34572: NOT governed, 9 changed lines (≤ 3000). It is 13 first-parent commits behind main (under 15).

It goes ready and auto-merge through the ordinary queue. This is the fix for the p0 queue-flake anchor #34523, which the merge closes (Fixes #34523).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 17, 2026 02:13
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 96c800a Nov 17, 2026
50 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-34523-comment-mask-process-budget branch November 17, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Queue-flake anchor: scripts/__tests__/check-hand-rolled-comment-mask.test.ts

2 participants