mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
ci: fail fast when a server never comes up
the readiness loops fell through silently after 30 tries, so a server that never started surfaced as an opaque driver failure minutes later. each now says what did not answer and on which port.
This commit is contained in:
1 parent
7c845ff498
commit
9a05add30c
2 files changed
+18
-3
No files matched your search
@@ -64,10 +64,15 @@ http.server.HTTPServer(("127.0.0.1", port), handler).serve_forever()
|
|||||||
PY
|
PY
|
||||||
server_pid=$!
|
server_pid=$!
|
||||||
trap 'kill "$server_pid" 2>/dev/null' EXIT
|
trap 'kill "$server_pid" 2>/dev/null' EXIT
|
||||||
|
ready=""
|
||||||
for _ in $(seq 1 30); do
|
for _ in $(seq 1 30); do
|
||||||
curl -sf "http://127.0.0.1:$port/index.html" >/dev/null && break
|
curl -sf "http://127.0.0.1:$port/index.html" >/dev/null && { ready=1; break; }
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
if [ -z "$ready" ]; then
|
||||||
|
echo "folio/web: the app server never served index.html on 127.0.0.1:$port from $dist" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
folio_args=(--platform web --bundle-id "http://127.0.0.1:$port/index.html")
|
folio_args=(--platform web --bundle-id "http://127.0.0.1:$port/index.html")
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
@@ -69,10 +69,15 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
python3 -m http.server 8792 --bind 127.0.0.1 \
|
python3 -m http.server 8792 --bind 127.0.0.1 \
|
||||||
--directory test/browser/testdata/throwing &
|
--directory test/browser/testdata/throwing &
|
||||||
|
ready=""
|
||||||
for _ in $(seq 1 30); do
|
for _ in $(seq 1 30); do
|
||||||
curl -sf http://127.0.0.1:8792/ >/dev/null && break
|
curl -sf http://127.0.0.1:8792/ >/dev/null && { ready=1; break; }
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
if [ -z "$ready" ]; then
|
||||||
|
echo "the fixture http server never answered on 127.0.0.1:8792" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
./bin/sanderling test \
|
./bin/sanderling test \
|
||||||
--platform web \
|
--platform web \
|
||||||
--spec test/browser/testdata/throwing/spec.ts \
|
--spec test/browser/testdata/throwing/spec.ts \
|
||||||
@@ -85,10 +90,15 @@ jobs:
|
|||||||
# Flags before the positional argument: Go's flag package stops
|
# Flags before the positional argument: Go's flag package stops
|
||||||
# parsing at the first non-flag word.
|
# parsing at the first non-flag word.
|
||||||
./bin/sanderling replay --port 8793 --no-open runs/fixture &
|
./bin/sanderling replay --port 8793 --no-open runs/fixture &
|
||||||
|
ready=""
|
||||||
for _ in $(seq 1 30); do
|
for _ in $(seq 1 30); do
|
||||||
curl -sf http://127.0.0.1:8793/api/runs >/dev/null && break
|
curl -sf http://127.0.0.1:8793/api/runs >/dev/null && { ready=1; break; }
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
if [ -z "$ready" ]; then
|
||||||
|
echo "sanderling replay never served /api/runs on 127.0.0.1:8793" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
run_id="$(ls runs/fixture | head -1)"
|
run_id="$(ls runs/fixture | head -1)"
|
||||||
echo "RUN_URL=http://127.0.0.1:8793/runs/$run_id/steps/1" >> "$GITHUB_ENV"
|
echo "RUN_URL=http://127.0.0.1:8793/runs/$run_id/steps/1" >> "$GITHUB_ENV"
|
||||||
curl -sf "http://127.0.0.1:8793/runs/$run_id/steps/1" >/dev/null
|
curl -sf "http://127.0.0.1:8793/runs/$run_id/steps/1" >/dev/null
|
||||||
|
|||||||
Reference in new issue
Block a user