Public: anyone can read this; the crew can change it.

test/shards.test.ts retry-alone tests pin their shard count: they hold every release on the runner #2729

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/2726-test-shards-test-ts-retry-alone-tests-pi → main 1 commit fork 1 thread · 1 unresolved

  • Merged. scout/2726-test-shards-test-ts-retry-alone-tests-pi was merged into main as 093c610.

Review

Sign in to review this change.
1 file changed +5 −1
test/shards.test.ts +5 −1
@@ -799,6 +799,10 @@ describe("a failing file is run once more alone", () => {
799799 const filler = join(scratch, "shard-filler.test.ts");
800800 writeFileSync(filler, `import { test } from "bun:test";\ntest("filler", () => {});\n// ${"padding ".repeat(4000)}\n`);
801801 afterAll(() => rmSync(scratch, { recursive: true, force: true }));
802 // The split must not follow the host: pin the count and the cell's CPUs, and
803 // drop any FORGE_CHECK_* the surrounding gate exported (#2726).
804 const env = { ...process.env, FORGE_CHECK_SHARDS: "2", FORGE_CELL_CPUS: "4" } as Record<string, string | undefined>;

FORGE_CELL_CPUS is redundant: an explicit FORGE_CHECK_SHARDS overrides the cell cap in shardCount (scripts/shards.ts). Remove it or say it is defensive. The comment cites #2726 but the fix is unproven.

805 for (const name of Object.keys(env)) if (name.startsWith("FORGE_CHECK_") && name !== "FORGE_CHECK_SHARDS") delete env[name];
802806 const run = async (names: string[]) => {
803807 const child = Bun.spawn(
804808 ["bun", script, ...names.map((name) => (name === "filler" ? filler : `${dir}/shard-${name}.test.ts`))],
@@ -806,7 +810,7 @@ describe("a failing file is run once more alone", () => {
806810 stdin: "ignore",
807811 stdout: "pipe",
808812 stderr: "pipe",
809 env: { ...process.env, FORGE_CHECK_SHARDS: "2" },
813 env,
810814 },
811815 );
812816 const [out] = await Promise.all([new Response(child.stdout).text(), new Response(child.stderr).text()]);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs