diff --git a/tests/lifecycle/bats/bitcoin-knots.bats b/tests/lifecycle/bats/bitcoin-knots.bats index 4024e30d..235e6dcb 100644 --- a/tests/lifecycle/bats/bitcoin-knots.bats +++ b/tests/lifecycle/bats/bitcoin-knots.bats @@ -137,15 +137,23 @@ ssh_podman_ps() { @test "bitcoin.getinfo succeeds after restart" { [[ "${ARCHY_ALLOW_DESTRUCTIVE:-0}" == "1" ]] || skip "ARCHY_ALLOW_DESTRUCTIVE not set" - # Give bitcoind up to 60s to accept RPC after cold restart - local deadline=$(( $(date +%s) + 60 )) + # Give bitcoind up to 120s to accept RPC after a cold restart — reloading the + # block index + chainstate can take a while even on a synced node. + local deadline=$(( $(date +%s) + 120 )) while (( $(date +%s) < deadline )); do if rpc_call bitcoin.getinfo | jq -e '.error == null' >/dev/null 2>&1; then return 0 fi sleep 3 done - fail "bitcoin.getinfo never recovered after restart" + # NB: bats-assert's `fail` is not loaded in this file (only ../lib/rpc.bash), + # so emit + return non-zero directly rather than calling an undefined helper + # (which fails with "fail: command not found" / status 127 and hides the real + # reason). A node mid-IBD legitimately can't serve getinfo here — that's an + # environmental precondition (see required-stack "synced archival"), not a + # product regression. + echo "bitcoin.getinfo never recovered after restart within 120s" >&2 + return 1 } # ────────────────────────────────────────────────────────────────────