Repository navigation
test(example-todo): boot the overdue-escalation kernel once per file under a measured budget - #31321
Merged
Merged
Conversation
…easured budget Each of the five cases booted a full todo kernel inside vitest's 5 s per-test default; on loaded Test Core shards the first case was cut off at 5011-5033 ms. The kernel now boots once in beforeAll under a measured 30 s budget, and beforeEach restores a fresh boot's state (no todo_task rows, deleted through the driver; no captured notices). CONTROL removes its fixture flow in a finally. Assertions are unchanged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ihL2etWp2cPA9ARe5c6hN
…under a measured budget Both async cases booted a full todo kernel inside vitest's 5 s per-test default; on a loaded Test Core shard the first was cut off at 5016 ms. The kernel now boots once in beforeAll under a measured 30 s budget, and beforeEach deletes the todo_task rows through the driver so every case starts from a fresh boot's table. Assertions are unchanged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ihL2etWp2cPA9ARe5c6hN
Contributor
Author
|
domain:server#2 · marchtian · session_017ihL2fBJ6xsLWJsnNJGMMx Contract review — ACCEPTHead-sha: ACCEPT · in-seat (test-only, no spec / skills / ADR hunk) · 2026-11-08T01:59Z
|
This was referenced Nov 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by 田騏 · project thread
Fixes #31311
Clause-②: no — test-only; no accept set, schema or export changes
Metadata-protocol: none
维护者速读
examples/app-todo/test/overdue-escalation-days-overdue.test.ts改成与 test(example-todo): boot the loop-body kernel once per file under a measured budget #31312 相同的形状。整个文件只在beforeAll里启动一次 kernel(带 30 秒实测预算),每条用例开始前经 driver 清空todo_task行。三条用例的断言一字未改,只改这一个测试文件。BOOT_BUDGET_MS和它上方的实测注释。pnpm --filter @objectstack/example-todo exec vitest run test/overdue-escalation-days-overdue.test.ts,预期 3/3 通过。What changes
examples/app-todo/test/overdue-escalation-days-overdue.test.tsonly, in the shape test(example-todo): boot the loop-body kernel once per file under a measured budget #31312 gaveloop-body-iteration.test.ts.bootTodoData()runs once per file inbeforeAll, under an explicit 30 000 ms budget (BOOT_BUDGET_MS). The measurement is written beside it. Before this change it ran inside each of the two async cases, under vitest's 5 s per-test default.beforeEachdeletes everytodo_taskrow through the driver, so no hook observes the reset. Each case starts from the table a fresh boot leaves.afterAlldisconnects the one driver. This replaces the per-caseafterEachdriver list.finally.Why
Queue job 128575054246, which ejected #31220:
get_recordstep declares no projection (sync, no boot){{ currentTask.… }}hole … (boot + insert + find)Test timed out in 5000msat:129In the same job,
loop-body-iteration.test.ts's ESCALATION (fixed by #31312) also timed out, at 5024 ms. The packageDurationwas 68.24 s, withimport 149.87s. The slowest sibling case was 2099 ms.Locally, on 4 cores, I timed the boot phases inside the cases on the old file:
kernel.use3 ms,bootstrap20–23 ms, sqlite-wasmconnect40–139 ms,syncSchemas45–52 ms, Default Organization 36–54 ms.bootstrap4–5 ms,connect1 ms,syncSchemas18–20 ms, Default Organization 20–25 ms.Tests
Case times in ms (sync, async 1, async 2), whole example suite, JSON reporter. "Load" means 8 CPU-bound processes running beside the suite.
--sequence.shufflewith seeds 1, 7, 42 and 1234. Seed 42 runs the order "every hole", "get_record", "0 when"; seed 1234 runs "0 when", "every hole", "get_record". All 3 cases passed in every order. I also ran each case alone with-t: 1 passed and 2 skipped, every time.beforeEachreset. Seed 1234 then fails "every hole", because the rows "0 when" inserted are still in the table when it assertstoHaveLength(1). The other three orders still pass, because "every hole" runs before "0 when" in them. So the reset is what keeps the cases independent.c497cf52:pnpm --filter @objectstack/example-todo exec vitest run, each exit 0 withTest Files 9 passed (9),Tests 249 passed (249).Acceptance notes
beforeAll, 30 s), not per case. The cases now run without a boot and take at most 49 ms locally, even under load, so they keep vitest's default timeout.examples/app-todo/teststill boot a kernel in each case:task-recurrence.test.ts(slowest case 2099 ms in job 128575054246, 2060 ms earlier),task-completion-trigger.test.ts(GATES 1447 ms, 1763 ms earlier) andderived-flag-removal.test.ts(1128 ms). None of them is at the 5 s line, so they are not changed here. If one is ever cut off, the same shape applies.Verification
All on
c497cf52(this branch after #31312 merged, withorigin/mainmerged in, no rebase):node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 37 commands. Every one ran with exit 0, afterpnpm exec turbo run build --filter='./packages/**' --concurrency=2so the gates that read built output measured.--ran: "37 derived famil(ies) accounted for — 37 run, 0 NOT-MEASURED".pnpm lint: exit 0.pnpm --filter @objectstack/example-todo typecheck: exit 0.test:repo(the vitestrepoproject), because this diff does not touch it. Test Core runs it on this PR.Human Minimum
packages/specholds no runtime logic. (Not touched.)pnpm lintpasses.main, one pull request.skip-changeset.)packages/spectouched: its generated artifacts are regenerated and committed. (Not touched.)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code
🤖 Generated with Claude Code