Repository navigation
Commit e3385f0
committed
test(core): charge the entry-point pin's index import to collect, not to the per-case budget
`service-resolution-discriminator.contract.test.ts`'s last case awaited
`import('./index.js')` inside the `it` body, so the whole `@objectstack/core`
index graph was charged to vitest's default 5000ms per-case budget. The case
was measured at 5036ms and timed out on a loaded box while the same tree passed
on a quiet one: the pin's verdict was a function of the machine, not of the
code.
The import moves to module top, where the same load is charged to the collect
phase and no per-case budget applies. The case's assertions are symbol presence
and identity only -- they observe no side effect, no registration order and no
before/after state -- and the file already loads four modules of this package
statically, every one of which the index re-exports, so nothing about load
order changes for them.
Measured on this tree, same command, same worktree
(`vitest run --maxWorkers=2 --reporter=verbose` on that file alone):
before: case 2996ms; file `import 1.74s, tests 3.01s`; total 4.86s
after: case 0ms; file `import 4.62s, tests 8ms`; total 4.76s
The work is relocated, not removed -- which is the point: per-case budget
consumption goes from ~60% to ~0%.
Claude-Session: https://claude.ai/code/session_017ef78bLdybu3AffehKkhfk
Co-authored-by: Claude <noreply@anthropic.com>1 parent 24d622b commit e3385f0
1 file changed
Lines changed: 17 additions & 2 deletions
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
22 | 35 | | |
23 | 36 | | |
24 | 37 | | |
| |||
224 | 237 | | |
225 | 238 | | |
226 | 239 | | |
227 | | - | |
228 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
229 | 244 | | |
230 | 245 | | |
231 | 246 | | |
| |||
0 commit comments