Repository navigation
Commit e6dfeb0
test(verify): pay the first boot load at collection and share one boot per configuration in two harness suites (#26175)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XVdKSKTiX7AWsYagk2P8mJT)_
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.ts` under `packages/verify/src`, which the package's build does
not ship.
## What changed
Two `@objectstack/verify` harness 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 a `beforeAll`. 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. One `beforeAll` boots `app` with the flag off, records what the
cases read, and stops. Then it boots with `orgContext: 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 the
`orgContext: true` boot, 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 `fullName` lists compared).
## The reading, and the rows this PR brings under 10 s
The reading is refresh PR #25960's per-file list (runs `40200279306` and
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:
| file | #25960 slowest (runs over / executed) | local before → after,
median of 3 | this PR |
|:--|--:|--:|:--|
| `src/harness.app-default-profile.test.ts` | 18.90 s (1 / 2) | 6608 →
3126 ms (×0.47) | **under 10 s**: projected 8.9 s in CI |
| `src/harness.org-context.test.ts` | 16.60 s (1 / 2) | 6741 → 2431 ms
(×0.36) | **under 10 s**: projected 6.0 s in CI |
| `src/harness.key-custody.test.ts` | 22.41 s (2 / 2) | 6852–7338 ms,
untouched | open: see Acceptance notes |
| `src/harness.one-composition.test.ts` | 17.89 s (2 / 2) | 9206–10354
ms, untouched | open: see Acceptance notes |
| `src/handle.test.ts` | 17.30 s (1 / 2) | 3857–4253 ms, untouched |
open: already warmed, one shared boot |
The 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 one
`vitest run --maxWorkers=2` process 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's `endTime - startTime` leaves out a `beforeAll` that runs
before the first case, so it is not used. BASE `a6e8f95d6` copies and
HEAD files were interleaved A/B in the same lock hold.
| run | app-default BASE | app-default HEAD | org-context BASE |
org-context HEAD |
|--:|--:|--:|--:|--:|
| 1 | 6488 | 3126 | 6523 | 2431 |
| 2 | 7591 | 3523 | 6741 | 2702 |
| 3 | 6608 | 3023 | 7223 | 2263 |
**Cases still isolated.** `vitest run --sequence.shuffle
--sequence.seed=N` over 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 `bootStack`
calls (0.82–1.09 s each) puts the largest share in the default
datasource's schema sync on sql.js (`knex` `ensureConnection` / `query`
→ `driver-sqlite-wasm` `_query`, `driver-sql` `initObjects`). 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
on `6221027193`): 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).
- `#23181` remains 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.
- Both files: 11 / 11 passed in 6 A/B runs and 5 shuffled runs.
- `@objectstack/verify` whole suite (`vitest run --maxWorkers=2`): Test
Files 46 passed (46), Tests 393 passed (393), VERDICT command-exit 0.
- Gates at `cb29c5b4d`: `dispatch-gates --commands` derived 55 commands,
and all 55 exit 0. `--ran` reports "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
fetching `621a4876`) and `check:dual-build-cjs-loads` (eight packages
had no `dist/`; fixed by building them). Both exit 0 on the re-run.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Bmz18vLaqY8KsiVaCXL5zS)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3f970b9 commit e6dfeb0
2 files changed
Lines changed: 99 additions & 63 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
55 | 61 | | |
56 | 62 | | |
57 | 63 | | |
| |||
142 | 148 | | |
143 | 149 | | |
144 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
145 | 161 | | |
146 | 162 | | |
147 | 163 | | |
148 | | - | |
| 164 | + | |
149 | 165 | | |
150 | 166 | | |
151 | 167 | | |
| |||
162 | 178 | | |
163 | 179 | | |
164 | 180 | | |
165 | | - | |
| 181 | + | |
166 | 182 | | |
167 | 183 | | |
168 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
59 | 65 | | |
60 | 66 | | |
61 | 67 | | |
| |||
96 | 102 | | |
97 | 103 | | |
98 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
99 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
100 | 157 | | |
101 | 158 | | |
102 | 159 | | |
| |||
106 | 163 | | |
107 | 164 | | |
108 | 165 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 166 | + | |
| 167 | + | |
124 | 168 | | |
125 | 169 | | |
126 | 170 | | |
| |||
137 | 181 | | |
138 | 182 | | |
139 | 183 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
157 | 194 | | |
158 | 195 | | |
159 | 196 | | |
| |||
165 | 202 | | |
166 | 203 | | |
167 | 204 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
194 | 214 | | |
195 | 215 | | |
196 | 216 | | |
| |||
0 commit comments