Skip to content

Commit 9d971a8

Browse files
committed
ci: probe socket connectivity before sending inference RPC
The runtime smoke test leaves stale socket files after stopping baudbot. When the inference smoke starts baudbot fresh, the alias symlink still points to the old dead socket. Fix by verifying the socket is connectable (not just that the file exists) before proceeding with the RPC.
1 parent 75374b4 commit 9d971a8

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

bin/ci/smoke-agent-inference.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@ cleanup() {
3636
}
3737
trap cleanup EXIT
3838

39+
socket_is_connectable() {
40+
local sock="$1"
41+
sudo -u "$AGENT_USER" python3 -c "
42+
import socket, sys
43+
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
44+
try:
45+
s.settimeout(2)
46+
s.connect(sys.argv[1])
47+
s.close()
48+
except Exception:
49+
sys.exit(1)
50+
" "$sock" 2>/dev/null
51+
}
52+
3953
wait_for_control_socket() {
4054
local deadline=$((SECONDS + START_TIMEOUT_SECONDS))
4155
local target=""
@@ -47,7 +61,7 @@ wait_for_control_socket() {
4761
if [[ "$target" != /* ]]; then
4862
target="${CONTROL_DIR}/${target}"
4963
fi
50-
if [[ -S "$target" ]]; then
64+
if [[ -S "$target" ]] && socket_is_connectable "$target"; then
5165
printf '%s\n' "$target"
5266
return 0
5367
fi

0 commit comments

Comments
 (0)