← Back to Pull requests

itest: stop the watch-only node in the macaroon enforcement test #11622

Merged
Roasbeef merged 1 files (7 lines) on Nov 25, 2026 03:50 UTC
View on GitHub
Roasbeef Roasbeef commented on Nov 24, 2026 22:48 UTC
Author

In this PR, we stop the watch-only node that testOutboundRSMacaroonEnforcement creates, before generic harness cleanup can stop its signer out from under it.

PR #11614 added defer ht.Shutdown(watchOnly) to executeRemoteSignerTestCase, which covers the inbound and outbound fixture paths including psbt. That helper does not cover every watch-only node: testOutboundRSMacaroonEnforcement builds its own with ht.CreateNewNode and never stopped it. At subtest cleanup shutdownAllNodes walks activeNodes, which is a Go map, so iteration order is unspecified and the signer can be stopped and its temporary directory removed while the watch-only node is still running. The watch-only node's periodic signer health check depends on the TLS certificate and macaroon that live in that directory, so it fails its final attempt and lnd exits with the remote signer exit code (14), reported as wait process exit got err: exit status 14 at lntest/harness.go:470.

This is the failure seen in the basic itests job for remote_signer-psbt:WatchOnly (run 45355462091, job 138317000161). It is the same failure mode #11614 fixed elsewhere, on the one path that helper does not reach.

What I can and cannot claim: go build -tags dev ./itest/ passes, and the change removes the only remaining unordered-teardown path for a watch-only node. I could not reproduce the teardown ordering locally — itests need the full binary and miner tranche harness, and the failure depends on map iteration order — so this is a structural fix for a live path, not a reproduced flake with a before/after run count. I am stating that plainly rather than implying a reproduction I do not have.

Test-only, no production code touched, and no assertion weakened.

Refs #11507.

Diff: 7 lines (+7 / -0) across 1 files Reviewer: ziggie1984 Review duration: 302m
All Vouch review confidence checks passed
Residual risk 0.07 = Change Risk (0.15) × (1 − Review Confidence (0.56)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.15 · 7 lines diff across 1 files
0.15
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
55%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth shallow_review_depth
0.289
Diff Size diff_size
0.124
Real PR Conversation Timeline
3 items
ziggie1984 ziggie1984 approved these changes on Nov 25, 2026 02:44 UTC
Approved Reviewer

LGTM

litbot-9000 litbot-9000 approved these changes on Nov 25, 2026 02:50 UTC
Approved Reviewer

/gateway review

Approve — no blockers. The fix is a clean 7-line defer ht.Shutdown(watchOnly) placed right after the watch-only startup, exactly the pattern #11614 used — applied here to the one path that helper doesn't reach: testOutboundRSMacaroonEnforcement builds its own watch-only node with ht.NewNodeWatchOnly (line 233) and never stopped it, so unordered map-ordered harness teardown could remove the signer's temp dir while the watch-only node's health check still depended on the credentials in it (the exit-code-14 failure mode).

Verified: the function structure confirms the gap (the node is created and used throughout, with no shutdown before this change), and go build -tags dev ./itest/ passes at the head. The comment accurately names the failure and the exit code. Test-only, no production code, no assertion weakened. The PR body's plain statement that it's a structural fix rather than a reproduced flake is the right framing for a map-ordering-dependent teardown race.

— claudell ⚡ (OpenClaw dev agent; approval posts as litbot-9000 and does not count toward branch protection)

Reviewers
Assignees
Roasbeef Roasbeef
Labels
risk: low confidence: 55.8% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 15.4% (LOW) · Higher = larger blast radius
15.4%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 55.8% · Lower = rushed or shallow review
55.8%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 6.8% · Safe to merge
6.8%