diff --git a/tests/boundary/filesystem/ciTestProjects.test.ts b/tests/boundary/filesystem/ciTestProjects.test.ts index cd92d63d54..a484e086af 100644 --- a/tests/boundary/filesystem/ciTestProjects.test.ts +++ b/tests/boundary/filesystem/ciTestProjects.test.ts @@ -152,7 +152,7 @@ describe("Vitest project configuration", () => { processTest.for( [ - { flags: [], timeout: 30_000, lines: 68 }, + { flags: [], timeout: 30_000, lines: 68, alsoHosted: true }, { flags: ["--coverage"], timeout: 60_000, lines: 68 }, { flags: ["--coverage.enabled"], timeout: 60_000, lines: 68 }, { flags: ["--coverage=false"], timeout: 30_000, lines: 68 }, @@ -170,19 +170,20 @@ describe("Vitest project configuration", () => { flags: ["--coverage.enabled", "--shard", "1/6"], timeout: 60_000, lines: 0, + alsoHosted: true, }, { flags: ["--coverage.enabled=false", "--shard=1/6"], timeout: 30_000, lines: 0, }, - ].flatMap((policy) => - // Hosted CI owns a four-core runner: up to four workers, doubled deadlines. - [ - { ...policy, hosted: false, workers: 2, scale: 1 }, - { ...policy, hosted: true, workers: 4, scale: 2 }, - ], - ), + ].flatMap(({ alsoHosted, ...policy }) => [ + { ...policy, hosted: false, workers: 2, scale: 1 }, + // Check hosted scaling with coverage both off and on. + ...(alsoHosted + ? [{ ...policy, hosted: true, workers: 4, scale: 2 }] + : []), + ]), )( "resolves worker resources from actual CLI options: $flags (hosted: $hosted)", async ( diff --git a/tests/evaluation/testDeadlines.test.ts b/tests/evaluation/testDeadlines.test.ts index 45e0daead8..c612cbead5 100644 --- a/tests/evaluation/testDeadlines.test.ts +++ b/tests/evaluation/testDeadlines.test.ts @@ -30,14 +30,12 @@ it("derives a wait or child deadline from the test deadline, keeping a reporting expect(remainingTestDeadline(0, 0)).toBeUndefined(); }); -it("bounds expect.poll by the project deadline", async () => { +it("bounds both wait helpers by the project deadline", async () => { const ready = performance.now() + PAST_VITEST_WAIT_DEFAULT_MS; - await expect.poll(() => performance.now() >= ready).toBe(true); -}); - -it("bounds waitFor by its test's deadline", async () => { - const ready = performance.now() + PAST_VITEST_WAIT_DEFAULT_MS; - await waitFor(() => { - if (performance.now() < ready) throw new Error("not ready yet"); - }); + await Promise.all([ + expect.poll(() => performance.now() >= ready).toBe(true), + waitFor(() => { + if (performance.now() < ready) throw new Error("not ready yet"); + }), + ]); });