Repository navigation
test(service-knowledge): measured timeouts for the multi-node sync-state cases - #38378
Conversation
…d timeouts The rebuild-through-node-A case boots four kernels over one file, seeds three records, runs two rebuilds and restarts both nodes inside vitest's default 5000 ms; under the merge queue's full-suite load it timed out. Each multi-node case in the file now carries an explicit budget of 20x its worst locally measured duration under doubled suite load. No case is skipped and no assertion or waitFor changes. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 L1 verdict (L1-a): ACCEPT at head Review summary
Landing condition: the failed check. Next: Tier S. The area lands it once every check is green at this head, then re-queues #38341. |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP Landing · area o1-C · head
The verdict's landing condition is met: the claim on #38376 (comment 7242879995) names this branch, and |
Part of #37736
Closes #38376
Clause-②: no
Metadata-protocol: none
维护者速读
用户无感:只改知识库同步状态的一个测试文件里四个多节点用例的超时上限,产品代码一行未动。
为什么做:这个用例在合并队列高负载下超过默认 5 秒被判超时,把一个无关的 PR 踢出了队列(属于知识库同步状态的工作)。
出错会怎样:最坏只是超时上限偏宽、真卡住的用例要多等十几秒才报红;可直接撤回本 PR。
要你做什么:无。
What changes
packages/services/service-knowledge/src/__tests__/sync-state.test.tsonly. The case "a rebuild through node A reads identically on node B while it runs and after it ends — an index already current included — and after both restart" boots four kernels over one SQLite file, seeds three records (each a queued record sync it waits on), runs two rebuilds (each followed by avi.waitForof 5000 ms) and restarts both nodes, all inside vitest's default 5000 mstestTimeout. Under the merge queue's full-suite load it timed out twice:Error: Test timed out in 5000ms.; green on its one re-run);Each multi-node case in the file now carries an explicit per-case timeout, with a one-line reason comment naming its shape and its measured worst:
Headroom factor x20: the queue shard ran the first case past 5000 ms, at least 3.9x its worst local reading under doubled load (1279 ms), so the factor is that observed floor rounded to 4 and multiplied by a further 5x margin. Nothing is skipped, no assertion changes, and no
vi.waitForchanges. The single-node cases are not in this shape and are unchanged.No changeset: the package publishes
dist,README.mdandCHANGELOG.mdonly; the test file is not an entry point (builtdist/holds zero hits for the new comment text, while the positive controlsys_knowledge_sync_statehitsdist/index.jsanddist/index.cjs), so this PR carriesskip-changeset. An empty-frontmatter changeset is refused bycheck-empty-changeset.Tests
All measured at
77e6bad77df(basebc31d453ea9) on a 4-vCPU container, underos-verify-lock.sh, from vitest's JSON reporter (per-caseduration, ms; cases in file order).File alone, 5 runs (--maxWorkers=2)
Inside the full service-knowledge suite, 3 runs (--maxWorkers=2; 700/700 each)
Doubled load: two full suites at once, --maxWorkers=4 each, on 4 vCPU (load average 6.90), 2 rounds; 700/700 each
First-case warm-up control: the cluster-lock case run alone (so it runs first), 3 runs
About 250 ms of the first case's cost is the file's first-case warm-up, not its own work;
check:test-source-alias(which reads clocked-window dynamic loads in an edited test's reach) is green on this tree, so the warm-up is not a module load the gate's rule would move to module top.Package test and typecheck after the edit (77e6bad)
No ablation: the diff changes only per-case timeouts, not a behaviour any test pins.
Acceptance notes
pnpm check:dual-build-cjs-loadsexited 3 (PREREQUISITE NOT MET) inside the sequential gate run, and its output was overwritten before it was read; a standalone rerun exited 0 (126 require entry points across 74 packages load). The--ranrecord keeps both readings and counts it NOT MEASURED; CI's run is the verdict.Verification
Files to read first:
packages/services/service-knowledge/src/__tests__/sync-state.test.ts, the four}, N_000);closings and the comment line above eachit.Two minutes:
pnpm --filter @objectstack/service-knowledge exec vitest run --maxWorkers=2 src/__tests__/sync-state.test.tsprintsTests 12 passed (12).Local gates:
node scripts/pm/dispatch-gates.mjs --commandsderived 53 families for this diff at77e6bad77df; 52 exited 0,check:dual-build-cjs-loadsas above.--ranreconciliation: 53 derived, 52 run, 1 NOT-MEASURED. Repo-wide scans and the rest of the farm are CI's.Generated by Claude Code