test(cli): retry build-exe --help once on SIGTERM

On loaded CI hosts the bundled binary occasionally takes longer than the
15s timeout to warm up, causing a SIGTERM and a flaky failure even though
the build is healthy. Retry once with a 60s timeout before reporting the
failure so transient slowness doesn't block releases.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-04-22 21:33:48 -07:00
parent 7e57ee48ef
commit dd6c6a0cd9

View File

@@ -93,10 +93,20 @@ describe("build-exe", () => {
// Verify no package.json in the isolated dir
expect(existsSync(join(dir, "package.json"))).toBe(false);
const result = spawnSync(binary, ["--help"], {
let result = spawnSync(binary, ["--help"], {
encoding: "utf-8",
timeout: 15_000,
});
// Rarely on loaded CI hosts the bundled binary can be slow to warm up.
// Retry once with a longer timeout if the first attempt was terminated.
if (result.status === null && result.signal === "SIGTERM") {
result = spawnSync(binary, ["--help"], {
encoding: "utf-8",
timeout: 60_000,
});
}
if (hasKnownBunSqliteLimitation(result)) {
return;
}