From 58656efe5f317951a2040479c6dfe9ea48801b3c Mon Sep 17 00:00:00 2001 From: ciregenz Date: Wed, 12 Aug 2026 22:26:18 -0700 Subject: [PATCH] [eric] smoke: refuse to run when :8324 is already taken, or a stray backend answers for the app under test --- scripts/smoke-packaged-mac.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/smoke-packaged-mac.sh b/scripts/smoke-packaged-mac.sh index bbc3f076..3545c3f0 100755 --- a/scripts/smoke-packaged-mac.sh +++ b/scripts/smoke-packaged-mac.sh @@ -106,6 +106,12 @@ rm -rf "$RUNDIR"; mkdir -p "$RUNDIR" cp -R "$APP" "$RUNDIR/" && ok "copied to a writable volume" || bad "could not copy the app off the DMG" RUNAPP="$RUNDIR/OpenSwarm.app" xattr -dr com.apple.quarantine "$RUNAPP" 2>/dev/null +# Nothing may already own :8324, or the curl below is answered by a stray dev backend and the smoke +# reports the app booted when it never did. Assert the port is free BEFORE launching, so the only +# thing that can answer is the app under test. +if lsof -nP -iTCP:8324 -sTCP:LISTEN >/dev/null 2>&1; then + bad "port :8324 is already taken" "kill the other backend first, or this check passes on its reply" +fi PATH="/usr/bin:/bin:/usr/sbin:/sbin" "$RUNAPP/Contents/MacOS/OpenSwarm" >/tmp/osw-smoke.log 2>&1 & LAUNCHED=$! BOOTED=0