Skip to content

Commit 6ba079b

Browse files
committed
test: bound the swiftc and xcrun calls so a stalled toolchain fails fast
This test compiles a Swift harness with execFileSync and no timeout, so a contended runner hangs the suite until the job-level timeout instead of failing it. That now matters more: the new regressions job gates tag creation, so a hang blocks a legitimate release rather than just a build. Investigated after a single unreproducible failure (12 runs clean). It is not a port race -- the server binds with listen(0) and the kernel assigns a free port. The unbounded toolchain calls are the actual exposure.
1 parent 268a160 commit 6ba079b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

macos/tests/bounded-community-http.test.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ function sdkPath() {
2222
if (existsSync(known)) return known;
2323
return execFileSync("/usr/bin/xcrun", ["--sdk", "macosx", "--show-sdk-path"], {
2424
encoding: "utf8",
25+
timeout: 60_000,
2526
}).trim();
2627
}
2728

@@ -79,13 +80,15 @@ test("bounded community HTTP client", {
7980
const binary = path.join(temporary, "bounded-community-http-test");
8081
try {
8182
const arch = process.arch === "arm64" ? "arm64" : "x86_64";
83+
// No timeout here means a contended CI runner can hang the whole suite
84+
// instead of failing it, and this test now gates tag creation.
8285
execFileSync("/usr/bin/swiftc", [
8386
"-sdk", sdkPath(),
8487
"-target", `${arch}-apple-macosx13.0`,
8588
source,
8689
harness,
8790
"-o", binary,
88-
], { stdio: "pipe" });
91+
], { stdio: "pipe", timeout: 180_000 });
8992
await new Promise((resolve, reject) => {
9093
server.once("error", reject);
9194
server.listen(0, "127.0.0.1", resolve);

0 commit comments

Comments
 (0)