From ccb594fb85bc2e802fb6936c769ee38d75a1b8e7 Mon Sep 17 00:00:00 2001 From: archipelago Date: Tue, 23 Jun 2026 06:28:20 -0400 Subject: [PATCH] test(gate): fix bitcoin-knots getinfo-after-restart helper + IBD note MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It called bats-assert's `fail` (not loaded in this file) → "fail: command not found"/127, masking the real reason. Emit+return instead, bump the cold-restart RPC window 60s→120s (block-index reload), and note a node mid-IBD legitimately can't serve getinfo (environmental precondition, not a product regression). Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/lifecycle/bats/bitcoin-knots.bats | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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 } # ────────────────────────────────────────────────────────────────────