Skip to content

Commit ac1cc8c

Browse files
authored
fix(cloud-connection): align the marketplace seed test's timeout with its sibling (#3785) (#4217)
marketplace-install-local-state-machine-exempt.test.ts failed under a full-repo `pnpm test` at 30s while passing every time the package ran alone. Both marketplace seed tests drive MarketplaceInstallLocalPlugin, whose seeding path dynamically imports the real @objectstack/runtime (unmocked on purpose, in both recordSeedSummary and mergeSeedDatasetsIntoKernel). That cold import costs seconds by itself and multiples of that under a fully parallel turbo run, and it is charged to whichever test triggers it first. The sibling marketplace-install-local-seed-lookup.test.ts was diagnosed as exactly this — "an import stall, not a hang" — and raised to 120s. This file was left at 30s and kept flaking the same way. The budget is now aligned, with the rationale stated locally instead of only in the sibling. The flaky set is exactly the intersection of "does not mock @objectstack/runtime" and "actually drives seeding": conflict, bundle no mock, but never reach the import default reseed, heal mock the module default seed-lookup no mock, seeds 120s (already) state-machine-exempt no mock, seeds 120s (here) So the two tests #3785 recorded are the only two that can hit this, and no other file needs the same treatment. Evidence this is a budget shortfall and not a race: the assertion passes (no missing seed rows), and under the same full-parallel load that produced the 30076ms failure the test now completes in 15696ms. Note that single pass alone does not prove the fix — 15.7s would have fit the old budget too. The argument is the ratio: a cost whose typical value is ~15s under load, and which has been observed above 30s, cannot live inside a 30s budget. 120s matches the sibling and leaves a genuine hang detectable, just later. Refs #3785
1 parent 90c2b15 commit ac1cc8c

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
"@objectstack/cloud-connection": patch
3+
---
4+
5+
fix(cloud-connection): align the marketplace seed test's timeout with its sibling (#3785)
6+
7+
`marketplace-install-local-state-machine-exempt.test.ts` failed under a
8+
full-repo `pnpm test` at 30s, while passing every time the package ran alone.
9+
10+
Both marketplace seed tests drive `MarketplaceInstallLocalPlugin`, whose
11+
seeding path dynamically imports the real `@objectstack/runtime` (unmocked on
12+
purpose, twice: `recordSeedSummary` and `mergeSeedDatasetsIntoKernel`). That
13+
cold import costs seconds by itself and multiples of that under a fully
14+
parallel turbo run, and it is charged to whichever test triggers it first.
15+
16+
Its sibling `marketplace-install-local-seed-lookup.test.ts` was diagnosed as
17+
exactly this — *"an import stall, not a hang"* — and raised to 120s. This file
18+
was left at 30s and kept flaking the same way. The budget is now aligned, with
19+
the rationale stated locally rather than only in the sibling.
20+
21+
The flaky set turns out to be exactly the intersection of "does not mock
22+
`@objectstack/runtime`" and "actually drives seeding":
23+
24+
| test | mocks runtime | drives seeding | budget |
25+
| :--- | :--- | :--- | :--- |
26+
| `conflict`, `bundle` | no | **no** — never reaches the import | default |
27+
| `reseed`, `heal` | **yes** | yes | default |
28+
| `seed-lookup` | no | yes | 120s (already) |
29+
| `state-machine-exempt` | no | yes | 120s (this change) |
30+
31+
So the two tests #3785 recorded are the only two that can hit this, and no
32+
other file needs the same treatment. A genuine hang still fails — later.

packages/cloud-connection/src/marketplace-install-local-state-machine-exempt.test.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,16 @@ beforeEach(() => { dir = mkdtempSync(join(tmpdir(), 'mil-fsm-exempt-')); });
208208
afterEach(() => { rmSync(dir, { recursive: true, force: true }); vi.restoreAllMocks(); });
209209

210210
describe('marketplace install — state_machine initialStates exemption (#3433)', () => {
211-
it('lands every mid-lifecycle seed row (no initialStates rejection on the marketplace seam)', { timeout: 30_000 }, async () => {
211+
// Same budget, same reason, as `marketplace-install-local-seed-lookup.test.ts`
212+
// (#3785): both drive `MarketplaceInstallLocalPlugin`, whose install handler
213+
// dynamically imports the real @objectstack/runtime (unmocked on purpose).
214+
// That cold import costs seconds on its own and multiples of that under a
215+
// fully parallel turbo run, where this file competes with every other
216+
// package's suite for cores. The sibling was diagnosed as exactly this —
217+
// "an import stall, not a hang" — and raised to 120s; this one was left at
218+
// 30s and kept flaking the same way (observed again at 30076ms). A genuine
219+
// hang still fails here, just later.
220+
it('lands every mid-lifecycle seed row (no initialStates rejection on the marketplace seam)', { timeout: 120_000 }, async () => {
212221
const { engine, store, registry } = makeEngine();
213222
const rawApp = makeRawApp();
214223
const { ctx, fire } = makeCtx(rawApp, {

0 commit comments

Comments
 (0)