fix(tests): settle window for quadlet active-state asserts (123/124)
mempool-api exits at startup while electrumx is catching up to the daemon (7-day initial-sync ETA on .228), flapping through 'activating' for ~2 min after each lifecycle cycle before systemd heals it. The instant asserts probed inside that window both iterations. Poll up to 180s for converges-to-active — a genuine crash-loop still fails. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
24fd97ed98
commit
e21f3baf22
@ -147,8 +147,18 @@ require_quadlet_backends() {
|
||||
while read -r name; do
|
||||
[[ -z "$name" ]] && continue
|
||||
is_user_stopped "$name" && continue
|
||||
run systemctl --user is-active "$name.service"
|
||||
[[ "$status" -eq 0 ]] || fail "$name.service is '$output' — expected 'active'"
|
||||
# Converges-to-active, not instantly-active: a dependency-degraded app
|
||||
# (mempool-api while electrumx catches up to the daemon) exits at startup
|
||||
# and flaps through 'activating' for a couple of minutes after a lifecycle
|
||||
# cycle; systemd's Restart=on-failure heals it. A genuine crash-loop still
|
||||
# fails after the settle window (gate 2026-07-09, .228 iterations 1+2).
|
||||
local state="" deadline=$((SECONDS + 180))
|
||||
while (( SECONDS < deadline )); do
|
||||
state="$(systemctl --user is-active "$name.service" 2>&1)" && break
|
||||
sleep 5
|
||||
done
|
||||
[[ "$state" == "active" ]] \
|
||||
|| fail "$name.service is '$state' — did not reach 'active' within 180s"
|
||||
done < <(backend_quadlet_units)
|
||||
}
|
||||
|
||||
@ -157,9 +167,16 @@ require_quadlet_backends() {
|
||||
while read -r name; do
|
||||
[[ -z "$name" ]] && continue
|
||||
is_user_stopped "$name" && continue
|
||||
run sh -c "podman inspect --format '{{.State.Running}}' '$name'"
|
||||
[[ "$status" -eq 0 ]] || fail "$name not present in podman"
|
||||
[[ "$output" == "true" ]] || fail "$name container exists but not running (state=$output)"
|
||||
# Same settle window as the active-state assert above: a quadlet --rm
|
||||
# container is absent for a few seconds around each systemd retry.
|
||||
local state="" deadline=$((SECONDS + 180))
|
||||
while (( SECONDS < deadline )); do
|
||||
state="$(podman inspect --format '{{.State.Running}}' "$name" 2>/dev/null)" \
|
||||
&& [[ "$state" == "true" ]] && break
|
||||
sleep 5
|
||||
done
|
||||
[[ "$state" == "true" ]] \
|
||||
|| fail "$name has no running container within 180s (state=${state:-absent})"
|
||||
done < <(backend_quadlet_units)
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user