itest: stop the watch-only node in the macaroon enforcement test #11622
LGTM
/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)
ziggie1984
Roasbeef
In this PR, we stop the watch-only node that
testOutboundRSMacaroonEnforcementcreates, before generic harness cleanup can stop its signer out from under it.PR #11614 added
defer ht.Shutdown(watchOnly)toexecuteRemoteSignerTestCase, which covers the inbound and outbound fixture paths includingpsbt. That helper does not cover every watch-only node:testOutboundRSMacaroonEnforcementbuilds its own withht.CreateNewNodeand never stopped it. At subtest cleanupshutdownAllNodeswalksactiveNodes, 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 aswait process exit got err: exit status 14atlntest/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.