From 5c029a982afaa4dc19b8a1859a7995b19c614edc Mon Sep 17 00:00:00 2001 From: faumaray Date: Sun, 25 Oct 2026 03:30:02 +0300 Subject: [PATCH] Start the smoke's action when its listener is on the server, not after 3 s roundtrip started the listener in the background, waited a fixed 3 s and ran the action (the poke, the private message, the avatar request, the file upload). A dev server that is slow to let a client in (4 s and more, 13 s seen, when the machine is busy) left the action running against a client that was not on the server yet: `error: message: the client is not on the server`, and `FAIL: private message: the action failed` (the action's client printed `connected: 2 clients` and the listener's `connected: 1 clients` came after). That is one of the places at which the earlier steps of the smoke flaked. voelinctl engine prints `connected: N clients` once its client is on the server and has seen the presence, for every action; roundtrip now waits for that line in the listener's log (60 s at most, and not when the listener has ended) and then 1 s more, for the others on the server to see the listener. Co-Authored-By: Claude Sonnet 5.5 --- scripts/it-smoke.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/it-smoke.sh b/scripts/it-smoke.sh index 12990ff..2f2c71b 100755 --- a/scripts/it-smoke.sh +++ b/scripts/it-smoke.sh @@ -413,12 +413,22 @@ server_uid() { "$VOELINCTL" identity show --identity "$id" | awk -v f="$field:" '$1 == f { print $2 }' } -# Run a background listener, then the action; both must succeed. +# Run a background listener, then the action; both must succeed. The action +# starts once the listener says it is on the server ("connected: N clients", +# which voelinctl engine prints for every action): a fixed pause of 3 s sent +# the poke, the private message or the avatar request to a client that was not +# on the server yet whenever the dev server was slow to let one in ("the +# client is not on the server"; a loaded dev server takes 4 to 13 s). roundtrip() { local what=$1 listen_log=$2 listener_cmd=$3 action_cmd=$4 eval "$listener_cmd" >"$listen_log" 2>&1 & local listener=$! - sleep 3 + for _ in $(seq 1 240); do + grep -q '^connected:' "$listen_log" 2>/dev/null && break + kill -0 "$listener" 2>/dev/null || break + sleep 0.25 + done + sleep 1 if ! eval "$action_cmd" >"$STATE_DIR/action.log" 2>&1; then cat "$STATE_DIR/action.log" "$listen_log" fail "$what: the action failed"