Skip to content

Commit 6b60f88

Browse files
test(verify): the two untimed requires-knowledge cases take the file's 120_000 budget (#37708)
<!-- claude-projects-attribution: {"github_login":"os-bill"} --> _Requested by **Bill** · [project thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg3zXREECfPtgrM8TPQaxn1v)_ Fixes #37700 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户无感:只改了一份内部测试的等待上限,产品行为前后不变。 - 为什么做:知识库能力的一条新测试在主干定时全量构建里超时,把主干标红;本改动让它在繁忙的构建机上也有足够时间。 - 出错会怎样:最坏只是这条测试仍偶发超时,主干再红一次,可直接撤回,不影响任何用户。 - 要你做什么:无。 ## What changes `packages/verify/src/harness.required-providers.test.ts` only. The two cases in the `requires: ['knowledge']` describe that still ran on vitest's 5000 ms default now take the file's per-case `120_000`, which every other boot/import case in the file already carries. Each carries a comment with its measurement: - **an install without the optional libSQL store** (the failing case). It clears the module cache (`vi.resetModules()`) and `constructServedProviders` then re-imports the provider graph. Local: 1138 / 1358 / 1365 ms over three runs. The scheduled run 45888214247 (job 140145134703, Test Core 10/10) read this file's tests at 57.8 s, which is 52.8 s outside this case against 16.2 s locally, so 3.3x. 1365 ms x 3.3 = 4.5 s, which leaves no margin under 5000 ms. The case was killed at 5000 ms. - **a host that mounts the service itself**. The same `constructServedProviders` shape, and it had no timeout either. 111-114 ms in file order, 431 ms alone on a cold cache (`-t`). x 3.3 = 1.4 s cold. It is not failing today; it gets the same budget so the risk is covered the same way. The other three knowledge cases already carry `120_000`. I chose a per-case timeout over a shared boot (the #28631 shape) because the slow case is not a repeated boot. Its cost is a module re-import that it causes on purpose, and nothing could share it. The file's own convention is a per-case `120_000`. Nothing is skipped. ## Tests <details><summary>File run on the final head, plus three earlier measurement runs</summary> ``` head fdf439c: pnpm --filter @objectstack/verify exec vitest run --maxWorkers=2 --reporter=verbose src/harness.required-providers.test.ts ✓ ... a host that mounts the service itself keeps its own, and the runtime adds no store 235ms ✓ ... an install without the optional libSQL store: ... says so once 1487ms Test Files 1 passed (1) Tests 15 passed (15) os-verify-lock: VERDICT command-exit 0 measurement runs (base 9476092, verbose): libSQL case 1138 / 1358 / 1365 ms; host case 114 / 113 / 111 ms; file tests 17.44 / 17.19 / 17.55 s; host case alone (-t) 431 ms pnpm --filter @objectstack/verify typecheck -> VERDICT command-exit 0 (check:test-typecheck: OK, the test layer compiles) ``` </details> ## Acceptance notes - `overlap-check`: `#37676 (shares packages/verify/src/harness.required-providers.test.ts): merges cleanly`, `VERDICT clean exit 0`. The overlap is textual only. - The file's `test-budget: 28` header is out of date. The CI run above read the file at 57.8 s (including the 5 s timeout), and its own text says "the first CI reading after the knowledge boots re-measures it". This PR does not re-set the budget, because that is outside the card's acceptance. Noted here for the lane. - No changeset. The diff is a `*.test.ts` under `src/`. `@objectstack/verify` ships `dist`, `README.md` and `CHANGELOG.md`. After `pnpm --filter @objectstack/verify build`, grepping `dist` finds 0 hits for the case title, and the positive control `bootStack` is found (`dist/index.js`, `dist/index.cjs`). The PR carries `skip-changeset`. ## Verification Read first: the one hunk at the end of the knowledge describe (the libSQL case's closing `}, 120_000);` and its comment). Two-minute check: `pnpm --filter @objectstack/verify exec vitest run --reporter=verbose src/harness.required-providers.test.ts` should print 15 passed, with the libSQL case at about 1-1.5 s locally. The real proof is the next scheduled full run going green on Test Core 10/10. --- _Generated by [Claude Code](https://claude.ai/code/session_01Utp6Cb4BAjgQ43tqy1DvVJ)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent e491fce commit 6b60f88

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎packages/verify/src/harness.required-providers.test.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,10 @@ describe("requires: ['knowledge'] — the knowledge service and one store", () =
368368
).map((p) => (p as { name?: string }).name);
369369
expect(served).toEqual(expect.arrayContaining([KNOWLEDGE, TURSO]));
370370
expect(served).not.toContain(PGVECTOR);
371-
});
371+
// Budget, as the last case's: 111-114 ms in file order, 431 ms run alone on a cold module cache
372+
// (local, three runs); the full run's last shard read this file at 3.3x local, so 1.4 s cold —
373+
// the file's 120_000 keeps it off vitest's 5000 ms default on a loaded runner.
374+
}, 120_000);
372375

373376
// The arm `os dev` and `os serve` mount on SQLite: a FILE database, so the
374377
// store is a libSQL file whose URL the operator may save in Settings. On a
@@ -463,5 +466,10 @@ describe("requires: ['knowledge'] — the knowledge service and one store", () =
463466
vi.doUnmock('@objectstack/knowledge-turso');
464467
vi.resetModules();
465468
}
466-
});
469+
// Budget: the module cache was just cleared, so constructServedProviders re-imports the provider
470+
// graph — 1138-1365 ms locally (three runs, verbose reporter). The scheduled full run's last Test
471+
// Core shard (run 45888214247) took this file at 3.3x local (52.8 s of tests outside this case vs
472+
// 16.2 s) and ran this case past vitest's 5000 ms default; 1365 ms x 3.3 = 4.5 s leaves no margin
473+
// there, so it takes the file's per-case 120_000 like every boot above.
474+
}, 120_000);
467475
});

0 commit comments

Comments
 (0)