test(lifecycle): don't let one RPC hiccup hide which app failed
The stop/start/restart loop carefully accumulates per-app failures into
$fails and prints them, but the three rpc_result calls were bare. Under
bats' errexit a bare call ends the test immediately, so the summary that
names the app never ran.
On 2026-08-08 that turned a single transient error into an unattributable
failure: the test died at package.stop with no indication which of the
ten targets was involved. It was mempool, and the identical call returned
{"status":"stopping"} by hand a few minutes later.
Each call now records <id>:<phase>-rpc and moves to the next app, so the
run reports what actually broke.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
e6428afd76
commit
b565c31ea9
@@ -129,11 +129,21 @@ catalog_install_payload() {
|
||||
local fails="" id
|
||||
for id in $(target_apps); do
|
||||
[[ "$(app_state "$id")" == "running" ]] || continue # only cycle running apps
|
||||
rpc_result package.stop "{\"id\":\"$id\"}" >/dev/null 2>&1
|
||||
# Each rpc_result must be allowed to fail without aborting the loop.
|
||||
# rpc_result returns non-zero whenever the response carries .error, and
|
||||
# under bats' errexit a bare call ends the test right there — so a single
|
||||
# transient RPC hiccup killed the run BEFORE the $fails summary below could
|
||||
# name the app. That is exactly what happened on 2026-08-08: the whole test
|
||||
# died at package.stop with no indication of which of the ten targets it was
|
||||
# (it was mempool, and the same call succeeded by hand moments later).
|
||||
rpc_result package.stop "{\"id\":\"$id\"}" >/dev/null 2>&1 \
|
||||
|| { fails+="$id:stop-rpc "; continue; }
|
||||
wait_state "$id" stopped 120 || { fails+="$id:stop "; }
|
||||
rpc_result package.start "{\"id\":\"$id\"}" >/dev/null 2>&1
|
||||
rpc_result package.start "{\"id\":\"$id\"}" >/dev/null 2>&1 \
|
||||
|| { fails+="$id:start-rpc "; continue; }
|
||||
wait_state "$id" running 240 || { fails+="$id:start "; continue; }
|
||||
rpc_result package.restart "{\"id\":\"$id\"}" >/dev/null 2>&1
|
||||
rpc_result package.restart "{\"id\":\"$id\"}" >/dev/null 2>&1 \
|
||||
|| { fails+="$id:restart-rpc "; continue; }
|
||||
wait_state "$id" running 240 || { fails+="$id:restart "; }
|
||||
done
|
||||
[[ -z "$fails" ]] || { echo "# lifecycle failures: $fails" >&3; false; }
|
||||
|
||||
Reference in New Issue
Block a user