test(integration): extract bringUpRPCNode bring-up helper#467
Conversation
The fresh-RPC-node bring-up tail (CreateNode -> WaitReady -> WaitCaughtUp -> WaitEVMServing, with per-gate progress logs) was duplicated verbatim in provision's node loop and in release_test.go. What's duplicated is the gate protocol + ordering + teardown-registration contract, not incidental line-shape, so extract a named helper both sites share: - bringUpRPCNode(ctx, t, c, hc, nodeSpec) (*sei.Node, error): error- returning core; logs each gate as it passes (kept INSIDE the helper so a stall stays localizable in real time); returns the node non-nil once created even on a later gate failure, so callers still register it for teardown. - provision propagates the error up its chain; release wraps it in t.Fatal. Same error-core / caller-picks-severity seam as runTaskWait. Behavior-preserving except one approved delta: release now emits the three per-gate log lines it lacked (replacing one combined line) — better stall localization. Error text, gate ordering, and teardown semantics unchanged. The four post-perturbation liveness assertions (post-release/-resync/-fault /-load) are intentionally left inline — distinct concept, heterogeneous gates and fatal/non-fatal polarity. Reviewed via /xreview (idiom + adversarial behavior-preservation, both RATIFY). gofmt, go vet -tags integration, golangci-lint -tags integration all clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PR SummaryLow Risk Overview The helper owns per-gate progress logs (“running”, “caught up”, “EVM serving”) and returns the Callers keep their own failure style: Reviewed by Cursor Bugbot for commit 46a60eb. Bugbot is set up for automated code reviews on this repo. Configure here. |
What
Extracts the fresh-RPC-node bring-up tail —
CreateNode → WaitReady → WaitCaughtUp → WaitEVMServingwith per-gate progress logs — that was duplicated verbatim inprovision's node loop and inrelease_test.go. What's duplicated is the gate protocol + ordering + teardown-registration contract, not incidental line-shape, so the two sites now share one named helper (past CLAUDE.md's "three similar lines" bar because it's a correctness-coupling that must move in lockstep).The helper (
harness_test.go, next toprovision)provisionpropagates up its chain;releasewraps int.Fatal. Same error-core / caller-picks-severity seam as the existingrunTaskWait/runTaskComplete.nodenon-nil once created, even on a later gate failure, so the caller still registers it for teardown (if node != nil { append }). Nil only whenCreateNodeitself fails — matching the prior pre-append-then-wait semantics exactly.Behavior
Preserving except one approved delta:
releasenow emits the 3 per-gate log lines it lacked (replacing its single combined line) — better stall localization. Error text,%wwrap chains, gate ordering, and teardown registration are unchanged at both sites. (release also gains a%wchain, strictly improvingerrors.Is/Aswith no output change.)The four post-perturbation liveness assertions (post-release / -resync / -fault / -load) are intentionally left inline — a distinct concept with heterogeneous gates and fatal/non-fatal polarity; unifying them would need severity+gate-subset flags, the opposite of what the extraction is for.
Verification
gofmt -l,go vet -tags integration,golangci-lint run --build-tags integration— all clean (0 issues)hc-hoist inertness, scope, compile) and RATIFIED. Two advisory idiom nits (param-shadow rename,t.Fatal(err)) folded in.Third and final piece of the integration-harness cleanup arc (after #465 fan-out/docs, #466 seiload lint).
🤖 Generated with Claude Code