mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-16 09:55:29 +02:00
test(config): signal-killed spawns map to -1, not exit 0
Both cfg() helpers defaulted a null spawn status to 0 — a child killed by signal would read as success and mask real failures. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
7be0c69e32
commit
8a150fcb58
@@ -23,7 +23,8 @@ function cfg(args: string[]): { code: number; out: string; err: string } {
|
|||||||
encoding: "utf8",
|
encoding: "utf8",
|
||||||
env: { ...process.env, GSTACK_STATE_ROOT: stateRoot },
|
env: { ...process.env, GSTACK_STATE_ROOT: stateRoot },
|
||||||
});
|
});
|
||||||
return { code: r.status ?? 0, out: r.stdout ?? "", err: r.stderr ?? "" };
|
// null status = killed by signal, never success — map to -1, not 0.
|
||||||
|
return { code: r.status ?? -1, out: r.stdout ?? "", err: r.stderr ?? "" };
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ function cfg(args: string[]): { code: number; out: string; err: string } {
|
|||||||
env: { ...process.env, GSTACK_HOME: home },
|
env: { ...process.env, GSTACK_HOME: home },
|
||||||
timeout: 30_000,
|
timeout: 30_000,
|
||||||
});
|
});
|
||||||
return { code: r.status ?? 0, out: r.stdout ?? "", err: r.stderr ?? "" };
|
// null status = killed by signal, never success — map to -1, not 0.
|
||||||
|
return { code: r.status ?? -1, out: r.stdout ?? "", err: r.stderr ?? "" };
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user