mirror of
https://github.com/morluto/rea.git
synced 2026-11-10 00:36:35 +00:00
fix(process): apply one timeout rule to both execFileOutput modes
Node's execFile timeout contract differs by supported runtime: Node 22 and 24 accept any non-negative integer (their timers clamp anything above 2^31-1 to 1 ms), while Node 26 caps it at Number.MAX_SAFE_INTEGER. Mirroring either left stoppable and plain commands disagreeing on one runtime. Validate a safe non-negative integer before spawning in both modes, so every supported runtime gives the same answer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
59c91c88fe
commit
3d328193d6
2 files changed
+7
-8
No files matched your search
@@ -123,8 +123,8 @@ describe.skipIf(process.platform === "win32")(
|
||||
expect(await readFile(stopped, "utf8")).toBe("SIGINT");
|
||||
});
|
||||
|
||||
it.each([-1, Number.NaN, 1.5, Number.POSITIVE_INFINITY])(
|
||||
"refuses a malformed timeout (%s) before starting the command, as execFile does",
|
||||
it.each([-1, Number.NaN, 1.5, Number.POSITIVE_INFINITY, 2 ** 53])(
|
||||
"refuses a malformed timeout (%s) in both modes before starting the command",
|
||||
async (timeout) => {
|
||||
// Starting this command would fail with ENOENT instead.
|
||||
await expect(
|
||||
|
||||
Reference in new issue
Block a user