fix(runtime/signal): use op_async_unref for op_signal_poll (#11097)

This commit is contained in:
Yoshiya Hinosawa 2021-06-25 13:15:35 +09:00 committed by GitHub
parent 66c5f41c5b
commit 606611708c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 62 additions and 7 deletions

View file

@ -129,6 +129,24 @@ unitTest(
},
);
// This tests that pending op_signal_poll doesn't block the runtime from exiting the process.
unitTest(
{ ignore: Deno.build.os === "windows", perms: { run: true, read: true } },
async function signalStreamExitTest(): Promise<void> {
const p = Deno.run({
cmd: [
Deno.execPath(),
"eval",
"--unstable",
"(async () => { for await (const _ of Deno.signals.io()) {} })()",
],
});
const res = await p.status();
assertEquals(res.code, 0);
p.close();
},
);
unitTest(
{ ignore: Deno.build.os === "windows", perms: { run: true } },
async function signalPromiseTest(): Promise<void> {