Replace sleep with wait-for-tcp script in run-tests.sh and CI workflow to improve reliability of smoke tests. Update TESTING.md to include prerequisites for the new script.
All checks were successful
Smoke tests / Build and smoke test (push) Successful in 1m17s
All checks were successful
Smoke tests / Build and smoke test (push) Successful in 1m17s
This commit is contained in:
13
scripts/ci/wait-for-tcp.sh
Executable file
13
scripts/ci/wait-for-tcp.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
host=${1:-127.0.0.1}
|
||||
port=${2:-2222}
|
||||
max_attempts=${3:-30}
|
||||
for _ in $(seq 1 "$max_attempts"); do
|
||||
if nc -z -w 1 "$host" "$port" 2>/dev/null; then
|
||||
exit 0
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
echo "timeout waiting for $host:$port" >&2
|
||||
exit 1
|
||||
Reference in New Issue
Block a user