diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2023-12-20 07:55:09 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-20 07:55:09 +0530 |
commit | 26cf06ed9f5c0ffa42afff3dbe29533ddcb2fbf7 (patch) | |
tree | cf834709f662c7ce0cdd17813837b45b9fea9e9c /cli/tests/unit_node/child_process_test.ts | |
parent | 5aa27c45f1cae6f0121e0860cd4be329ced887a6 (diff) |
fix(node): child_process kill cancel pending IPC reads (#21647)
Diffstat (limited to 'cli/tests/unit_node/child_process_test.ts')
-rw-r--r-- | cli/tests/unit_node/child_process_test.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/cli/tests/unit_node/child_process_test.ts b/cli/tests/unit_node/child_process_test.ts index 79617cf3d..421e66dfd 100644 --- a/cli/tests/unit_node/child_process_test.ts +++ b/cli/tests/unit_node/child_process_test.ts @@ -731,3 +731,26 @@ Deno.test(function spawnSyncExitNonZero() { assertEquals(ret.status, 22); }); + +// https://github.com/denoland/deno/issues/21630 +Deno.test(async function forkIpcKillDoesNotHang() { + const testdataDir = path.join( + path.dirname(path.fromFileUrl(import.meta.url)), + "testdata", + ); + const script = path.join( + testdataDir, + "node_modules", + "foo", + "index.js", + ); + const p = Promise.withResolvers<void>(); + const cp = CP.fork(script, [], { + cwd: testdataDir, + stdio: ["inherit", "inherit", "inherit", "ipc"], + }); + cp.on("close", () => p.resolve()); + cp.kill(); + + await p.promise; +}); |