Skip to content

Commit fdfc841

Browse files
committed
Make scan suite robust on CI: bind fixtures to loopback, loosen perf bound
1 parent c58f16a commit fdfc841

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

test/test_scan.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ P_HTTPS=6706 # HTTPS-only HTML app -> found via https fallback (if openss
5757
P_IPV6=6707 # IPv6-only (::1) HTML app -> found via the [::1] probe (Vite v6's default)
5858

5959
start_html_server() { # port directory
60-
python3 -m http.server "$1" --directory "$2" >/dev/null 2>&1 &
60+
# Bind loopback explicitly. python's default (0.0.0.0) is found locally but not on the
61+
# GitHub macOS runner, and real dev servers bind 127.0.0.1/::1 anyway — which is exactly
62+
# what scan probes.
63+
python3 -m http.server "$1" --bind 127.0.0.1 --directory "$2" >/dev/null 2>&1 &
6164
PIDS+=("$!")
6265
}
6366
start_json_server() { # port
@@ -240,9 +243,11 @@ start=$(date +%s)
240243
"$DEVKIT" scan --json >/dev/null
241244
end=$(date +%s)
242245
elapsed=$((end - start))
243-
# With batched parallelism, even a busy machine should finish in a few timeouts, not
244-
# (ports * timeout). Generous ceiling of 15s catches accidental serialization.
245-
assert_eq "scan finished under 15s" "true" "$( (( elapsed < 15 )) && echo true || echo false )"
246+
# This scans every listener on the host, so the absolute time scales with how many ports
247+
# are up (unbounded on a busy dev box). The point is only that batched parallelism keeps it
248+
# bounded, not (ports * timeout): a 60s ceiling clears any realistic machine while a
249+
# serialized regression (minutes) still trips it.
250+
assert_eq "scan finished under 60s" "true" "$( (( elapsed < 60 )) && echo true || echo false )"
246251

247252
# ---------- summary ----------
248253
echo

0 commit comments

Comments
 (0)