Repository navigation
test(verify): pay the first boot load at collection and share one boot per configuration in two harness suites - #26175
Merged
Conversation
…t per configuration in two harness suites harness.app-default-profile and harness.org-context booted a fresh stack in every case, and paid the boot's first load inside the first case's clock. Both now warm up at module scope (boot-warm-up.testkit.ts), and cases that read the same configuration under the same options read one boot from a beforeAll: app-default-profile 4 boots to 3, org-context 4 boots to 2, with every assertion unchanged in what it reads. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bmz18vLaqY8KsiVaCXL5zS
Contributor
📓 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): |
Contributor
Author
席位核对 · ACCEPT ·
|
| item | reading |
|---|---|
| Shape | Draft, base main, Part of #23181 (slice 9), skip-changeset, mergeable clean. |
| Files | 2 files, +99/−63: packages/verify/src/harness.app-default-profile.test.ts and harness.org-context.test.ts. Both use the existing boot-warm-up.testkit.ts (on main). |
| Fix | Each file pays the boot's first load at collection (warmUpBoot()), and cases that read the same boot configuration share one boot in a beforeAll. app-default-profile: the two read-only cases on the declared default. org-context: one bootAndRead per option set, then the cases assert its reading. Every case keeps its assertion. No timeout raised and nothing deleted. |
| Evidence | app-default-profile 6,608 → 3,126 ms and org-context 6,741 → 2,431 ms (interleaved A/B, median of 3); projected CI 8.9 s and 6.0 s. Shuffle seeds 1–5 green. The verify suite passes 393/393. 55/55 gates exit 0, --ran reconciled. On this head 36 check runs succeeded and 16 skipped as expected, with 0 failed. |
| Carried | key-custody, one-composition and handle.test are left untouched, with reasons given in the report. The open question goes with the dev's recommendation: wait for the next refresh, then file a card on bootStack's per-boot cost if those rows remain. |
| Landing | 「按照 pm-dispatch 规则复核过的都授权」 (Leehom, 2026-10-25T11:35Z): ready and auto-merge through the relay. |
Generated by Claude Code
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 Leehom · project thread
Part of #23181 (slice 9). The card stays open for its other rows.
Clause-②: no
Metadata-protocol: none
Test files only, so this PR carries
skip-changeset: both files are*.test.tsunderpackages/verify/src, which the package's build does not ship.What changed
Two
@objectstack/verifyharness suites booted a fresh in-process stack in every case and paid the boot's first load inside the first case's clock.src/harness.app-default-profile.test.ts:await warmUpBoot()at module scope (boot-warm-up.testkit.ts, the convention slices 3 and 4 used). The first two cases now read ONE boot of the declared-default configuration from abeforeAll. The first reads the profile the boot wired; the second signs a member up and reads as them. Neither reads what the other writes. Boots: 4 → 3.src/harness.org-context.test.ts:await warmUpBoot()at module scope. OnebeforeAllbootsappwith the flag off, records what the cases read, and stops. Then it boots withorgContext: true, records, and stops, in the same order the ruling case always booted them. The ruling case compares the two recorded postures, the bind case reads theorgContext: trueboot, and the default-boot case reads the default boot. Boots: 4 → 2.Every assertion reads the same value of the same boot shape (same configuration, same options) as before. The test full names are identical before and after (sorted
fullNamelists compared).The reading, and the rows this PR brings under 10 s
The reading is refresh PR #25960's per-file list (runs
40200279306and others in its window). The newest LANDED refresh, #25409, lists no per-file rows; slice 8's report records why. Of this family, #25960 still lists five rows:src/harness.app-default-profile.test.tssrc/harness.org-context.test.tssrc/harness.key-custody.test.tssrc/harness.one-composition.test.tssrc/handle.test.tsThe pin is the next landed refresh: it should no longer name the two rows marked under 10 s.
Measurement
On one 4-vCPU box, under
os-verify-lock. It is a shared box, so the ratios carry the result rather than the absolute times. Each run is onevitest run --maxWorkers=2process per file. The number is the default reporter's file line (the module's duration: hooks included, collection excluded), which is the figure the timing refresh reads. The json reporter'sendTime - startTimeleaves out abeforeAllthat runs before the first case, so it is not used. BASEa6e8f95d6copies and HEAD files were interleaved A/B in the same lock hold.Cases still isolated.
vitest run --sequence.shuffle --sequence.seed=Nover both files, seeds 1 to 5: 11 / 11 passed each time. With seed 1, the member sign-up case ran before the profile read on the shared boot. With seed 2, the default-boot case ran before the ruling case.Where a boot's time goes. A CPU profile of six warm
bootStackcalls (0.82–1.09 s each) puts the largest share in the default datasource's schema sync on sql.js (knexensureConnection/query→driver-sqlite-wasm_query,driver-sqlinitObjects). A test file can only boot fewer times; it cannot make a boot cheaper.Acceptance notes
harness.key-custody.test.ts(22.41 s, 2 / 2) is untouched. Each of its 5 boots runs under its own key posture, so no two boots can be shared. A warm-up is excluded there by slice 4's seat ruling (option A on6221027193): it would build the harness data key outside the keyless posture the file inspects.harness.one-composition.test.ts(17.89 s, 2 / 2) is untouched. It is already warmed. Each of its 12 boots is the subject of its case (the instance rule and composition), so no two can be shared. It reads 9.2–10.4 s locally.handle.test.ts(17.30 s, 1 of 2 runs over) is untouched. It is already warmed and boots once per file. The one reading over 10 s came from the window's most loaded run (40200279306, where all five rows took their slowest).#23181remains open for those rows and for the other packages' rows.Tests
pnpm --filter @objectstack/verify typecheck: VERDICT command-exit 0 (check:test-typecheck: OK, 0 debt).eslint --no-inline-config packages/verify: exit 0.@objectstack/verifywhole suite (vitest run --maxWorkers=2): Test Files 46 passed (46), Tests 393 passed (393), VERDICT command-exit 0.cb29c5b4d:dispatch-gates --commandsderived 55 commands, and all 55 exit 0.--ranreports "55 derived, 55 run, 0 NOT-MEASURED, 0 UNRUN" and exits 0. On the first pass two gates exited 3 with PREREQUISITE NOT MET, which is not a verdict:check-plugin-teardown-shape --self-test(shallow clone; fixed by fetching621a4876) andcheck:dual-build-cjs-loads(eight packages had nodist/; fixed by building them). Both exit 0 on the re-run.Generated by Claude Code