Skip to content

Commit b0354de

Browse files
committed
test: verify fixture retention at command settlement
1 parent d4d0f7f commit b0354de

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎test/scripts/direct-run-entrypoints.test.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ it("joins owned descendants and captures timeout output before deleting a reject
563563
);
564564
const failure = new Error("fixture callback rejected while the command was running");
565565
let root = "";
566+
let fixturePresentAtCommandSettlement: boolean | undefined;
566567
let command: ReturnType<typeof runNodeScript> | undefined;
567568
await runQaGatewayFixture(
568569
async () => {
@@ -606,7 +607,10 @@ child.once("message", () => fs.writeFileSync(${JSON.stringify(pidPaths[1])}, Str
606607
["--import", pathToFileURL(wrapperPidProbe).href, wrapperPath],
607608
env,
608609
fixtureRoot,
609-
);
610+
).then((result) => {
611+
fixturePresentAtCommandSettlement = existsSync(fixtureRoot);
612+
return result;
613+
});
610614
const implementationPid = await waitForPidFile(pidPaths[1]!, 5_000);
611615
expect(isProcessAlive(implementationPid)).toBe(true);
612616
throw failure;
@@ -619,6 +623,9 @@ child.once("message", () => fs.writeFileSync(${JSON.stringify(pidPaths[1])}, Str
619623
message: "Managed command timed out after 10000ms",
620624
});
621625
expect(result.status).toBeNull();
626+
expect(fixturePresentAtCommandSettlement, "command teardown still owns its fixture").toBe(
627+
true,
628+
);
622629
expect(result.stdout).toContain("transformed");
623630
expect(result.stdout).toContain("descendant stdout");
624631
expect(result.stderr).toContain("descendant stderr");

0 commit comments

Comments
 (0)