Skip to content

Commit 815f43f

Browse files
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

File tree

‎packages/qa/scenarios/test/skill-evals/skill-evals.test.ts‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ import { renderSummaryMarkdown, summariseRound } from '../../src/skill-evals/sum
2828
const scratch = mkdtempSync(join(tmpdir(), 'skill-evals-test-'));
2929
afterAll(() => rmSync(scratch, { recursive: true, force: true }));
3030

31+
// The two `--regrade` command tests run a full round, then `regradeRound`; the first of them to run in a
32+
// worker pays a load-bound cost the rest of the file does not. Measured, not vitest's 5 s default:
33+
// 36-168 ms locally, 2356 ms on a light Test Core shard (merge-queue job 134557796904), 6218 ms and
34+
// 9728 ms on the shard beside plugin-security (jobs 134498092500, 134551614597), where the second
35+
// one took 141 ms. 30 s is ~3x the slowest observed, the budget of this package's stand-in suites.
36+
const REGRADE_COMMAND_TEST_TIMEOUT_MS = 30_000;
37+
3138
/** A two-bundle catalog in the shape every `skills/BUNDLE/evals/*.json` uses. */
3239
function writeCatalog(): string {
3340
const root = mkdtempSync(join(scratch, 'skills-'));
@@ -400,7 +407,7 @@ describe('--regrade grades an old answer only against the case that ran', () =>
400407
expect(md).toContain('1 case(s) changed since the round, set apart: not regraded and out of every pass rate below: `alpha-skill/cases#2`');
401408
expect(md).toContain('2 record(s) carry no case hash');
402409
expect(md).not.toContain('| alpha-skill/cases#2 |');
403-
});
410+
}, REGRADE_COMMAND_TEST_TIMEOUT_MS);
404411
});
405412

406413
describe('trigger cases: graded on whether the with-skill turn loaded the bundle, reported beside the behaviour cases', () => {
@@ -527,7 +534,7 @@ describe('trigger cases: graded on whether the with-skill turn loaded the bundle
527534
const round = JSON.parse(readFileSync(join(dir, 'round.json'), 'utf8')) as { regraded: { added: string[] }; summary: { triggers: { cases: Array<{ key: string; tally: { pass: number; fail: number } }> } } };
528535
expect(round.regraded.added).toEqual([]);
529536
expect(round.summary.triggers.cases.map((t) => [t.key, t.tally.pass, t.tally.fail])).toEqual([['beta-skill/triggers#1', 0, 1], ['beta-skill/triggers#2', 1, 0]]);
530-
});
537+
}, REGRADE_COMMAND_TEST_TIMEOUT_MS);
531538
});
532539

533540
describe('`files`: what a case needs on disk, placed in the turn\'s project on both arms', () => {

0 commit comments

Comments
 (0)