From b565c31ea914e6dac901380fea0e1a04d3843319 Mon Sep 17 00:00:00 2001 From: archipelago Date: Sat, 8 Aug 2026 20:58:32 -0400 Subject: [PATCH] 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 :-rpc and moves to the next app, so the run reports what actually broke. Co-Authored-By: Claude Opus 5 (1M context) --- tests/lifecycle/bats/all-apps-lifecycle.bats | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/lifecycle/bats/all-apps-lifecycle.bats b/tests/lifecycle/bats/all-apps-lifecycle.bats index fce49404..d35c4c6b 100644 --- a/tests/lifecycle/bats/all-apps-lifecycle.bats +++ b/tests/lifecycle/bats/all-apps-lifecycle.bats @@ -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; }