From c86826ac5b35cbce61edbf8aedc770b56283ebda Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Thu, 21 Aug 2025 13:54:30 -0300 Subject: [PATCH] lntest: fix error check in shutdownAllNodes Previously the test failed only if the last node failed to shutdown. The code was updated to fail if any node failed to shutdown. --- lntest/harness.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lntest/harness.go b/lntest/harness.go index 5c5325220..ab02af7ab 100644 --- a/lntest/harness.go +++ b/lntest/harness.go @@ -435,9 +435,9 @@ func (h *HarnessTest) shutdownNodesNoAssert() { // shutdownAllNodes will shutdown all running nodes. func (h *HarnessTest) shutdownAllNodes() { - var err error + var lastErr error for _, node := range h.manager.activeNodes { - err = h.manager.shutdownNode(node) + err := h.manager.shutdownNode(node) if err == nil { continue } @@ -446,9 +446,11 @@ func (h *HarnessTest) shutdownAllNodes() { // is needed so other nodes can continue their shutdown // processes. h.Logf("unable to shutdown %s, got err: %v", node.Name(), err) + + lastErr = err } - require.NoError(h, err, "failed to shutdown all nodes") + require.NoError(h, lastErr, "failed to shutdown all nodes") } // cleanupStandbyNode is a function should be called with defer whenever a