Skip to content

Commit 734a85e

Browse files
committed
Address review feedback on port test and health check
- Port assertion: accept any port in auto-increment range, not just +1 - Summary label: fix misleading per-section counter display - Health check: add -f back now that HEAD / returns 200
1 parent 2579071 commit 734a85e

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ runs:
160160
exit 1
161161
fi
162162
ENDPOINT=$(grep 'listening on' "$SPICEIO_LOG" 2>/dev/null | grep -o 'http://[^ ]*' | tail -1 || true)
163-
if [[ -n "$ENDPOINT" ]] && curl -s -o /dev/null "$ENDPOINT/" 2>/dev/null; then
163+
if [[ -n "$ENDPOINT" ]] && curl -fsS -o /dev/null "$ENDPOINT/" 2>/dev/null; then
164164
echo "spiceio ready at $ENDPOINT (PID $PID)"
165165
echo "endpoint=$ENDPOINT" >> "$GITHUB_OUTPUT"
166166
exit 0

scripts/test-sccache.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,13 @@ if [[ -n "$ENDPOINT2" ]]; then
289289

290290
PORT1="${BIND##*:}"
291291
PORT2="${ENDPOINT2##*:}"
292-
assert_eq "port auto-incremented" "$((PORT1 + 1))" "$PORT2"
292+
if [[ "$PORT2" =~ ^[0-9]+$ ]] && (( PORT2 > PORT1 && PORT2 <= PORT1 + 100 )); then
293+
echo " PASS: port auto-incremented ($PORT1 -> $PORT2)"
294+
PASS=$((PASS + 1))
295+
else
296+
echo " FAIL: port should differ from $PORT1 and be within auto-increment range (got $PORT2)"
297+
FAIL=$((FAIL + 1))
298+
fi
293299

294300
# Both instances should serve requests
295301
assert_ok "first instance health check" curl -sf -o /dev/null "${ENDPOINT}/"
@@ -317,7 +323,8 @@ rm -f "$SPICEIO_LOG2"
317323

318324
echo ""
319325
echo "======================================="
320-
echo "[test] port auto-increment: $PASS passed, $FAIL failed"
326+
echo "[test] port auto-increment complete"
327+
echo "[test] cumulative assertions: $PASS passed, $FAIL failed"
321328
echo "======================================="
322329

323330
if [[ "$FAIL" -gt 0 ]]; then

0 commit comments

Comments
 (0)