test(artifacts): bound the FIFO inventory probe by direct child exit (#12422)

Co-authored-by: ShuaixinHuang <ShuaixinHuang@users.noreply.github.com>
This commit is contained in:
ShuaixinHuangandShuaixinHuang authored and GitHub committed 2026-11-19 14:40:54 -05:00
1 parent 9d717a52e2
commit 2630eff751
1 file changed
+11 -22
@@ -74,27 +74,16 @@ it.skipIf(process.platform === "win32")(
import.meta.url,
),
);
const launch = await spawnOwnedProviderProcess({
command: process.execPath,
arguments: [probe, readerModule, root],
runId: `rea-directory-entry-fifo-${randomUUID()}`,
cwd: tmpdir(),
hostEnvironment: process.env,
});
const supervisor = new ProviderProcessSupervisor({
...launch,
ownsProcessLifetime: true,
});
try {
expect(await supervisor.waitForOutputClose(2_000)).toBe(true);
expect(supervisor.snapshot().stdout.text.trim()).toBe('["module.js"]');
} finally {
const stopped = await supervisor.stop({
terminationGraceMs: 100,
killGraceMs: 500,
});
expect(stopped.status).not.toBe("incomplete");
}
// This probe only enumerates directory entries and has no descendants.
// Wait for its actual exit and keep a timeout in case enumeration blocks.
const { stdout } = await run(
process.execPath,
[probe, readerModule, root],
{
cwd: tmpdir(),
timeout: 5_000,
},
);
expect(stdout.trim()).toBe('["module.js"]');
},
);