Skip to content

Commit 0c52202

Browse files
baozhoutaoclaude
andauthored
test(lint): give the in-process cold-load case the same COLD_LOAD_TIMEOUT_MS its siblings carry (#5421) (#5434)
`runtime-lazy-deps.test.ts` has three cases that pay a cold load of the gate graph; two of them (the spawned CJS/ESM entries) already end with `COLD_LOAD_TIMEOUT_MS`, while the in-process one ran on vitest's 5 s default even though its first act is the same `import('./runtime.js')`. On a loaded box that case takes longer than 5 s and goes red on a claim the wall clock has nothing to do with — the boot path loading no source parser is proved by the require-cache assertions below it, never by how long the transform took. Measured on this container: 5383 ms with the budget, and a deterministic `Test timed out in 5000ms` without it. No assertion, constant or sibling case is touched. Claude-Session: https://claude.ai/code/session_016FNvXhtSdnEGEfLEsMmvxh Co-authored-by: Claude <noreply@anthropic.com>
1 parent 123067c commit 0c52202

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎packages/lint/src/runtime-lazy-deps.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ describe('@objectstack/lint/runtime (kernel boot-path contract, #4463)', () => {
121121
COLD_LOAD_TIMEOUT_MS,
122122
);
123123

124+
// Same cold load as the two above, just in-process: the first `import()` of
125+
// `./runtime.js` in this file pulls the whole gate graph through the transform.
126+
// So it gets the same budget — the claim being pinned (the boot path loads no
127+
// source parser) is proved by the assertions below, never by the wall clock,
128+
// and a 5 s default only turns a busy runner into a false red on the gate.
124129
it('gating a flow in-process loads neither dep, and still finds the defect', async () => {
125130
const req = createRequire(import.meta.url);
126131
const { runRuntimeAuthoringRules } = await import('./runtime.js');
@@ -140,7 +145,7 @@ describe('@objectstack/lint/runtime (kernel boot-path contract, #4463)', () => {
140145
`may not pay for a source parser to publish a flow`,
141146
).toBe(false);
142147
}
143-
});
148+
}, COLD_LOAD_TIMEOUT_MS);
144149

145150
it('the runtime entry re-exports the gate and nothing that carries a parser', async () => {
146151
const mod = await import('./runtime.js');

0 commit comments

Comments
 (0)