From 07ed1e2729052f33ae1fdb15bf23129d7dd29c2b Mon Sep 17 00:00:00 2001 From: Sam Sung <51686767+samwhosung@users.noreply.github.com> Date: Wed, 28 Oct 2026 05:15:30 +0700 Subject: [PATCH] smoke.sh no longer fails clean runs when grep -q quits early (#2735) `scripts/smoke.sh` and `scripts/summon-live.sh` run under `set -o pipefail` and checked their log markers as `printf '%s' "$log" | grep -q marker`. `grep -q` exits at its first match, so on a long log `printf` died of SIGPIPE, the pipeline returned 141, and a clean run failed: "no roster came on the same link after the logout", with the line right there in the log. Replaying the check on one 73 KB run log failed 15 times in 50. Each check now reads a here-string (`grep -q marker <<<"$log"`), which no early exit can break. The same replay passes 200 of 200, and a missing marker still fails the check. Fixes #2733 Co-Authored-By: Claude Opus 5.5 --- scripts/smoke.sh | 16 ++++++++-------- scripts/summon-live.sh | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/smoke.sh b/scripts/smoke.sh index 754cbe465..5a4a300ec 100755 --- a/scripts/smoke.sh +++ b/scripts/smoke.sh @@ -94,18 +94,18 @@ fail() { # Before the timeout check, which it usually explains: a WOW_CHAR not on the account leaves the # client waiting at the roster. -printf '%s' "$plain" | grep -q "not on this account" && +grep -q "not on this account" <<<"$plain" && fail "$char is not on $user — the client sat at the roster (make it, or rig it: WOW_RIG=…)" [ $code -eq 124 ] && fail "the client did not exit within the timeout" -printf '%s' "$plain" | grep -q "logout-smoke: empty roster" && +grep -q "logout-smoke: empty roster" <<<"$plain" && fail "$user has no characters — the re-entry leg cannot run (make one, or rig it: WOW_RIG=…)" -printf '%s' "$plain" | grep -q "logout-smoke: done" || +grep -q "logout-smoke: done" <<<"$plain" || fail "the round trip never completed (no 'logout-smoke: done')" # The logout returns to character select on the link the world was entered by and re-lists there # (`0x5aaeb0` → `0x46b880`): a roster on that world session, and one realmd logon for the walk. -printf '%s' "$plain" | grep -q "logout-smoke: FAILED" && +grep -q "logout-smoke: FAILED" <<<"$plain" && fail "$(printf '%s\n' "$plain" | sed -n 's/.*logout-smoke: FAILED — //p' | tail -1)" -printf '%s' "$plain" | grep -q "logout-smoke: roster after the logout on the same link" || +grep -q "logout-smoke: roster after the logout on the same link" <<<"$plain" || fail "no roster came on the same link after the logout" logons="$(printf '%s\n' "$plain" | grep -cF "net: parked at the realm list")" [ "$logons" -eq 1 ] || @@ -122,7 +122,7 @@ printf ' %-24s %s\n' "re-entry suppressors" "${sup:-}" # vmangos skips the logout root when resting, on a taxi or at account security >= `InstantLogout` # (`MiscHandler.cpp`, `CMSG_LOGOUT_REQUEST`); probe accounts are GM, so report whether the check # above met a real root. `player::wire_in::session_end_tests` forces the rooted case. -if printf '%s\n' "$plain" | grep -q "mover mode Root granted"; then +if grep -q "mover mode Root granted" <<<"$plain"; then printf ' %-24s %s\n' "rooted logout" "yes — the drivable check above is a real pass" else printf ' %-24s %s\n' "rooted logout" \ @@ -217,9 +217,9 @@ realm_fail() { exit 1 } [ $rcode -eq 124 ] && realm_fail "the realm walk did not finish within the timeout" -printf '%s' "$rplain" | grep -q "realm-smoke: FAILED" && +grep -q "realm-smoke: FAILED" <<<"$rplain" && realm_fail "$(printf '%s\n' "$rplain" | sed -n 's/.*realm-smoke: FAILED — //p' | tail -1)" -printf '%s' "$rplain" | grep -q "realm-smoke: done" || +grep -q "realm-smoke: done" <<<"$rplain" || realm_fail "the walk never completed (no 'realm-smoke: done')" rp="$(printf '%s\n' "$rplain" | grep -cE 'panicked at')" [ "$rp" -ne 0 ] && realm_fail "$rp panic(s)" diff --git a/scripts/summon-live.sh b/scripts/summon-live.sh index 2acc97e1d..4cf5739a2 100755 --- a/scripts/summon-live.sh +++ b/scripts/summon-live.sh @@ -101,11 +101,11 @@ printf '%s\n' "$plog" fail() { echo; echo "SUMMON-LIVE FAILED: $1"; strip "$work/rx.log" | grep -E "ERROR" | tail -10; exit 1; } [ $rx_code -eq 124 ] && fail "the receiver did not exit within the timeout" [ $tx_code -eq 124 ] && fail "the summoner did not exit within the timeout" -printf '%s' "$trace" | grep -q "recv SMSG_SUMMON_REQUEST" || +grep -q "recv SMSG_SUMMON_REQUEST" <<<"$trace" || fail "no summon request arrived — did the invite land? (see the summoner's lines above)" -printf '%s' "$trace" | grep -q "fire CONFIRM_SUMMON" || fail "the request landed but no event fired" -printf '%s' "$trace" | grep -q "SEND CMSG_SUMMON_RESPONSE" || fail "Accept sent no packet" -printf '%s' "$plog" | grep -q "wants to summon you to" || fail "the dialog text never composed" +grep -q "fire CONFIRM_SUMMON" <<<"$trace" || fail "the request landed but no event fired" +grep -q "SEND CMSG_SUMMON_RESPONSE" <<<"$trace" || fail "Accept sent no packet" +grep -q "wants to summon you to" <<<"$plog" || fail "the dialog text never composed" # The character must move, and land where the dialog said: that ties GetSummonConfirmAreaName to # the server rather than to our own AreaTable lookup. before="$(printf '%s' "$plog" | sed -n 's/^zone before=\[\(.*\)\]$/\1/p')"