Commit 0634d12f authored by Nick Mathewson's avatar Nick Mathewson 🤹
Browse files

chutney/setup: Wait for port 9150 to open after launching arti

This is not a replacement for a real startup protocol, but it may
help repair our CI.
parent c022155d
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -44,6 +44,20 @@ fi
	wait "$pid"
	echo "result=$?" >> tests/chutney/arti.run
) & disown

# Wait for arti to start listening (it does so "immediately", but we don't want to get there first)
# Really there should be a proper daemon startup protocol here, but arti doesn't have one yet.
for idx in $(seq 30); do
    if : >&/dev/null </dev/tcp/127.0.0.1/9150 ; then
	echo "Port 9150 seems open."
	break
    elif [ "$idx" == 30 ]; then
	echo "Waited 30 seconds without result; giving up on port 9150."
	exit 1
    else
	echo "waiting for port 9150..."
	sleep 1
    fi
done