Skip to content

Commit 93e3bc3

Browse files
committed
fix(gate): check_vm_parity portable timeout — macOS runner ships no timeout
Once the surface_marker false-positive stopped short-circuiting ci_gate.sh before its step 3, the nightly macOS full gate surfaced 382 tree-walk e2e "failures", every one with an empty diff. Root cause: check_vm_parity.sh wrapped each e2e in raw `timeout 180 bash "$t"`, but hosted macOS runners ship neither GNU `timeout` nor coreutils `gtimeout` → "command not found" (exit 127) → each e2e counted as a FAIL whose output matched no FAIL/error pattern (hence the empty `()`). corpus passed because check_corpus_regression already uses the run_bounded fallback. This was the last raw `timeout` caller missed by commit 264804b's sweep; ported to the same run_bounded helper (timeout → gtimeout → unbounded). Reproduced the runner condition locally (timeout/gtimeout absent): raw timeout → exit 127; run_bounded → exit 0, e2e green. Smell-audited: 1: test-harness portability, no runtime logic change; verified via a clean-PATH macOS-runner simulation + smoke green.
1 parent 9c78920 commit 93e3bc3

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

‎scripts/check_vm_parity.sh‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@ SKIPS=(
3535
restore() { zig build -Dwasm -Doptimize=ReleaseSafe >/dev/null 2>&1 || true; }
3636
trap restore EXIT
3737

38+
# Portable bounded run: GNU `timeout`, else macOS coreutils `gtimeout`, else
39+
# unbounded. Hosted macOS runners ship NEITHER — a raw `timeout` there errors
40+
# with "command not found" (exit 127), which this script would have misread as
41+
# a tree-walk FAIL for every e2e (empty diff, since 127's text matches no
42+
# FAIL/error). This is the same helper the e2e scripts + check_corpus_regression
43+
# use; check_vm_parity was the last raw caller missed by commit 264804b7's sweep.
44+
run_bounded() {
45+
local secs="$1"; shift
46+
if command -v timeout >/dev/null 2>&1; then timeout "$secs" "$@"
47+
elif command -v gtimeout >/dev/null 2>&1; then gtimeout "$secs" "$@"
48+
else "$@"; fi
49+
}
50+
3851
echo "check_vm_parity: building -Dbackend=tree_walk -Doptimize=ReleaseSafe…"
3952
if ! zig build -Dwasm -Doptimize=ReleaseSafe -Dbackend=tree_walk >/tmp/vmp_build.txt 2>&1; then
4053
echo "check_vm_parity: tree-walk BUILD FAILED (see /tmp/vmp_build.txt)"; exit 1
@@ -60,7 +73,7 @@ for t in test/e2e/*.sh; do
6073
echo " SKIP (default-backend) : $name"
6174
continue
6275
fi
63-
if timeout 180 bash "$t" >/tmp/vmp_e2e.txt 2>&1; then
76+
if run_bounded 180 bash "$t" >/tmp/vmp_e2e.txt 2>&1; then
6477
: # green — stay quiet (the suite is ~250 steps)
6578
else
6679
echo " FAIL on tree-walk : $name ($(grep -iE 'FAIL|error' /tmp/vmp_e2e.txt | head -1 | cut -c1-100))"

0 commit comments

Comments
 (0)