From 2de83e70a962601a94bc4fe63ccbc1eddf49c0ba Mon Sep 17 00:00:00 2001 From: Ben Vinegar Date: Tue, 28 Apr 2026 23:31:18 -0400 Subject: [PATCH 1/2] ci: wait for connectable control socket in arch smoke test --- bin/ci/smoke-agent-runtime.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/bin/ci/smoke-agent-runtime.sh b/bin/ci/smoke-agent-runtime.sh index 641a4d4..1cff678 100755 --- a/bin/ci/smoke-agent-runtime.sh +++ b/bin/ci/smoke-agent-runtime.sh @@ -44,6 +44,20 @@ cleanup() { } trap cleanup EXIT +socket_is_connectable() { + local sock="$1" + sudo -u "$AGENT_USER" python3 -c " +import socket, sys +s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) +try: + s.settimeout(2) + s.connect(sys.argv[1]) + s.close() +except Exception: + sys.exit(1) +" "$sock" 2>/dev/null +} + wait_for_control_socket() { local deadline=$((SECONDS + START_TIMEOUT_SECONDS)) local target="" @@ -55,7 +69,7 @@ wait_for_control_socket() { if [[ "$target" != /* ]]; then target="${CONTROL_DIR}/${target}" fi - if [[ -S "$target" ]]; then + if [[ -S "$target" ]] && socket_is_connectable "$target"; then printf '%s\n' "$target" return 0 fi From 09bf5e4d3a2cce2e694cb91447ed6c8158ddb977 Mon Sep 17 00:00:00 2001 From: Ben Vinegar Date: Tue, 28 Apr 2026 23:35:24 -0400 Subject: [PATCH 2/2] ci: close readiness probe sockets in runtime smoke test --- bin/ci/smoke-agent-runtime.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/ci/smoke-agent-runtime.sh b/bin/ci/smoke-agent-runtime.sh index 1cff678..d507d23 100755 --- a/bin/ci/smoke-agent-runtime.sh +++ b/bin/ci/smoke-agent-runtime.sh @@ -52,9 +52,10 @@ s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) try: s.settimeout(2) s.connect(sys.argv[1]) - s.close() except Exception: sys.exit(1) +finally: + s.close() " "$sock" 2>/dev/null }