fix: handle signal 0 in process.kill (#23473)

the last commit had a regression, where it removed this branch, I
haven't tested the code but I think it should work

---------

Signed-off-by: Bedis Nbiba <bedisnbiba@gmail.com>
This commit is contained in:
Bedis Nbiba 2024-05-19 19:52:03 +01:00 committed by GitHub
parent 9e890399fc
commit 927cbb5ecd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View file

@ -243,6 +243,11 @@ Deno.test(
args: ["eval", "setTimeout(() => {}, 10000)"],
}).spawn();
// kill with signal 0 should keep the process alive in linux (true means no error happened)
// windows ignore signals
if (Deno.build.os !== "windows") {
assertEquals(process.kill(p.pid, 0), true);
}
process.kill(p.pid);
await p.status;
},