Skip to content

Commit 0b1f813

Browse files
test: add test for checking timedOut flag is set on child process spawn
1 parent 51766b0 commit 0b1f813

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/parallel/test-child-process-spawn-timeout-kill-signal.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ const aliveForeverFile = 'child-process-stay-alive-forever.js';
3535
}), /ERR_OUT_OF_RANGE/);
3636
}
3737

38+
{
39+
// Verify timedOut flag is set true
40+
const cp = spawn(process.execPath, [fixtures.path(aliveForeverFile)], {
41+
timeout: 6,
42+
});
43+
strictEqual(cp.timedOut, false);
44+
cp.on('exit', mustCall(() => {
45+
strictEqual(cp.timedOut, true);
46+
}));
47+
}
48+
3849
{
3950
// Verify abort signal gets unregistered
4051
const controller = new AbortController();

0 commit comments

Comments
 (0)