From c0f0f9842ad59971d75a0e494891b0e659fcb57f Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Thu, 12 Dec 2024 18:55:35 +0100 Subject: [PATCH] WIP: Wait for server startup in distributable tests Without this we seem to hit issues in Mac 14 M1 usage in GHA sometimes - maybe during GHA high usage periods? --- test/distributables-test/unix.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/distributables-test/unix.sh b/test/distributables-test/unix.sh index ae0a35a9..a9871ac0 100755 --- a/test/distributables-test/unix.sh +++ b/test/distributables-test/unix.sh @@ -11,7 +11,14 @@ echo "\nStarting server..." ./httptoolkit-server/bin/httptoolkit-server start & SERVER_PID=$! -sleep 10 +echo "Waiting for server..." +for i in {1..30}; do + if curl -s http://127.0.0.1:45456/ >/dev/null 2>&1; then + echo "Server is up" + break + fi + sleep 1 +done echo "\nTesting server..."