mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
fix(cli/js/process): Always return a code in ProcessStatus (#5244)
This commit is contained in:
parent
4b7d3b060e
commit
8f050355ff
2 changed files with 25 additions and 14 deletions
|
@ -66,7 +66,7 @@ unitTest(
|
|||
});
|
||||
const status = await p.status();
|
||||
assertEquals(status.success, false);
|
||||
assertEquals(status.code, undefined);
|
||||
assertEquals(status.code, 128 + 9);
|
||||
assertEquals(status.signal, 9);
|
||||
p.close();
|
||||
}
|
||||
|
@ -358,11 +358,15 @@ unitTest({ perms: { run: true } }, async function killSuccess(): Promise<void> {
|
|||
const status = await p.status();
|
||||
|
||||
assertEquals(status.success, false);
|
||||
// TODO(ry) On Linux, status.code is sometimes undefined and sometimes 1.
|
||||
// The following assert is causing this test to be flaky. Investigate and
|
||||
// re-enable when it can be made deterministic.
|
||||
// assertEquals(status.code, 1);
|
||||
// assertEquals(status.signal, Deno.Signal.SIGINT);
|
||||
try {
|
||||
assertEquals(status.code, 128 + Deno.Signal.SIGINT);
|
||||
assertEquals(status.signal, Deno.Signal.SIGINT);
|
||||
} catch {
|
||||
// TODO(nayeemrmn): On Windows sometimes the following values are given
|
||||
// instead. Investigate and remove this catch when fixed.
|
||||
assertEquals(status.code, 1);
|
||||
assertEquals(status.signal, undefined);
|
||||
}
|
||||
p.close();
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue