Repository navigation
Commit 815f43f
test(scenarios): measured 30 s budget for the two skill-evals --regrade command tests (#35121)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8LvPEHAQYchQkNdLqwBqea3)_
Fixes #35110
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:skill-evals 测试文件里两条跑完整 `executeRound` + `regradeRound` 的
`--regrade` 命令测试,改用具名的 30 秒超时(`REGRADE_COMMAND_TEST_TIMEOUT_MS`),不再吃
vitest 默认 5 秒;断言一条未动。
- 为什么改:merge queue 把 scenarios 和 plugin-security 排在同一个 Test Core
分片时,这条测试实测 6.2 秒、9.7 秒,超时把 #34709 两次踢出队列;本地只要 36–168 毫秒。
- 风险与回滚:只动测试文件,不发布任何东西;真挂死时最多多等 25 秒才报红。回滚即 revert 这一个 commit。
- 先看:`packages/qa/scenarios/test/skill-evals/skill-evals.test.ts`
顶部新增常量及其注释(测量来源与取值理由),以及两处 `}, REGRADE_COMMAND_TEST_TIMEOUT_MS);`。
- 两分钟验证:`pnpm --filter @objectstack/scenarios exec vitest run
test/skill-evals/skill-evals.test.ts`,预期 36/36 通过。
- 需要你做的:无,席位落地。
## What changes
`packages/qa/scenarios/test/skill-evals/skill-evals.test.ts` only:
- A named constant `REGRADE_COMMAND_TEST_TIMEOUT_MS = 30_000` near the
top of the file, with a comment citing the queue measurements it is
sized from. This follows the package's existing convention
(`STAND_IN_TEST_TIMEOUT_MS = 30_000` in `test/runner/units.test.ts`, the
measured `30_000` budgets in `test/runner/external-driver.test.ts`).
- It is passed as the per-test timeout of the two tests that run a full
`executeRound` and then `regradeRound`:
- line 362 of the old file, "the command: a reworded case keeps its
record bytes ..." (the test the card names);
- "--regrade keeps a recorded trigger case planned and regrades it from
its record" (the sibling on the same path).
- Every assertion is kept. No skip, no retry, no quarantine, no
package-wide `testTimeout`.
## Tests
Timings, per test (ms):
| Where | reworded-case test (card) | trigger-case `--regrade` sibling |
file |
|:--|--:|--:|--:|
| CI, merge-queue job 134498092500 (shard 7/10, beside plugin-security)
| 6218 (timed out) | not reported | 7134 |
| CI, merge-queue job 134551614597 (same plan) | 9728 (timed out) | 141
| 10526 |
| CI, merge-queue job 134557796904 (shard 8/10, light) | 2356 | under
the reporter's threshold | 3149 |
| local, unloaded, 3 runs before the change | 168 / 35 / 36 | 40 / 47 /
35 | tests 239–380 |
| local, 12 CPU burners on 4 cores | 79 | 107 | tests 564 |
| local, 24 CPU burners on 4 cores | 102 | 106 | tests 848 |
| local, after the change | 40 | 52 | 36/36 pass |
How the timeout is sized: the slowest observed reading is 9728 ms; the
unloaded CI reading is 2356 ms. 30 s is about 3x the slowest observed
and about 13x the unloaded CI reading, and it is the budget this
package's other measured suites already use.
Where the cost sits: in the same CI job the reworded-case test took 9728
ms while the sibling on the identical `executeRound` + `regradeRound`
path took 141 ms, and the `executeRound`-only tests took tens of ms. So
the cost lands on the first `regradeRound` call in the file, not on the
round the test builds; the one thing that call does that the later one
does not is a cold first run of `runnerSha` (two `git` spawns over the
checkout). CPU oversubscription locally (up to 6x) did not reproduce it,
and a fresh worktree's first `git status` over the same pathspec took
141 ms here, so the mechanism is not established. Because the cost
follows whichever of the two runs first (a `-t` filter or a reorder
moves it to the sibling), both tests get the budget, although the
sibling does not measure within 2x of 5 s locally. The product code is
unchanged: the measurement does not show a product-side cost that a
behaviour-preserving change in `src/skill-evals/**` would remove.
<details><summary>Package suite and typecheck at 91523c8</summary>
```
pnpm --filter @objectstack/scenarios build && pnpm --filter @objectstack/scenarios typecheck && pnpm --filter @objectstack/scenarios test
Test Files 39 passed (39)
Tests 1144 passed (1144)
os-verify-lock: VERDICT command-exit 0
```
`tsc --noEmit --listFiles` includes
`test/skill-evals/skill-evals.test.ts` (count 1).
</details>
## Acceptance notes
- The CI cost of the first `regradeRound` call is located (first call
against second, same job) but its mechanism is not reproduced locally.
If a later reading shows the cost growing past this budget, `runnerSha`
(the `git rev-parse` + `git status` pair in `src/skill-evals/cli.ts`) is
the place to measure first.
- No changeset: the diff touches a test file only, which is not in the
package's `files[]` (`dist`, `README.md`, `CHANGELOG.md`), so nothing
publishes; `skip-changeset` rides this create.
- No ablation: the diff changes a test timeout, not a tested behaviour.
## Verification
<details><summary>Derived gates at 91523c8 (dispatch-gates
--commands, 49 families)</summary>
`node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack
--ran FILE` with exit codes recorded: `49 derived famil(ies) accounted
for — 48 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)`.
- 48 commands exit 0.
- NOT MEASURED: `pnpm check:dual-build-cjs-loads`, reason: PREREQUISITE
NOT MET (it reads every package's dist, and this worktree built only the
scenarios closure). CI runs it in `Lint & Repo Gates`.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01JQwxbaX2qDxUq9sF93EqqL)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 958ee03 commit 815f43f
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
31 | 38 | | |
32 | 39 | | |
33 | 40 | | |
| |||
400 | 407 | | |
401 | 408 | | |
402 | 409 | | |
403 | | - | |
| 410 | + | |
404 | 411 | | |
405 | 412 | | |
406 | 413 | | |
| |||
527 | 534 | | |
528 | 535 | | |
529 | 536 | | |
530 | | - | |
| 537 | + | |
531 | 538 | | |
532 | 539 | | |
533 | 540 | | |
| |||
0 commit comments