diff --git a/.changeset/marketplace-seed-test-budget.md b/.changeset/marketplace-seed-test-budget.md new file mode 100644 index 0000000000..d87b739d7f --- /dev/null +++ b/.changeset/marketplace-seed-test-budget.md @@ -0,0 +1,32 @@ +--- +"@objectstack/cloud-connection": patch +--- + +fix(cloud-connection): align the marketplace seed test's timeout with its sibling (#3785) + +`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, twice: `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. + +Its 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 rather than only in the sibling. + +The flaky set turns out to be exactly the intersection of "does not mock +`@objectstack/runtime`" and "actually drives seeding": + +| test | mocks runtime | drives seeding | budget | +| :--- | :--- | :--- | :--- | +| `conflict`, `bundle` | no | **no** — never reaches the import | default | +| `reseed`, `heal` | **yes** | yes | default | +| `seed-lookup` | no | yes | 120s (already) | +| `state-machine-exempt` | no | yes | 120s (this change) | + +So the two tests #3785 recorded are the only two that can hit this, and no +other file needs the same treatment. A genuine hang still fails — later. diff --git a/packages/cloud-connection/src/marketplace-install-local-state-machine-exempt.test.ts b/packages/cloud-connection/src/marketplace-install-local-state-machine-exempt.test.ts index dbf1fe55a4..f31d232e7d 100644 --- a/packages/cloud-connection/src/marketplace-install-local-state-machine-exempt.test.ts +++ b/packages/cloud-connection/src/marketplace-install-local-state-machine-exempt.test.ts @@ -208,7 +208,16 @@ beforeEach(() => { dir = mkdtempSync(join(tmpdir(), 'mil-fsm-exempt-')); }); afterEach(() => { rmSync(dir, { recursive: true, force: true }); vi.restoreAllMocks(); }); describe('marketplace install — state_machine initialStates exemption (#3433)', () => { - it('lands every mid-lifecycle seed row (no initialStates rejection on the marketplace seam)', { timeout: 30_000 }, async () => { + // Same budget, same reason, as `marketplace-install-local-seed-lookup.test.ts` + // (#3785): both drive `MarketplaceInstallLocalPlugin`, whose install handler + // dynamically imports the real @objectstack/runtime (unmocked on purpose). + // That cold import costs seconds on its own and multiples of that under a + // fully parallel turbo run, where this file competes with every other + // package's suite for cores. The sibling was diagnosed as exactly this — + // "an import stall, not a hang" — and raised to 120s; this one was left at + // 30s and kept flaking the same way (observed again at 30076ms). A genuine + // hang still fails here, just later. + it('lands every mid-lifecycle seed row (no initialStates rejection on the marketplace seam)', { timeout: 120_000 }, async () => { const { engine, store, registry } = makeEngine(); const rawApp = makeRawApp(); const { ctx, fire } = makeCtx(rawApp, {