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.
This commit is contained in:
Boris Nagaev committed 2025-08-30 14:13:44 -03:00
1 parent 630108b13d
commit c86826ac5b
1 file changed
+5 -3
+5 -3
View File
@@ -435,9 +435,9 @@ func (h *HarnessTest) shutdownNodesNoAssert() {
// shutdownAllNodes will shutdown all running nodes. // shutdownAllNodes will shutdown all running nodes.
func (h *HarnessTest) shutdownAllNodes() { func (h *HarnessTest) shutdownAllNodes() {
var err error var lastErr error
for _, node := range h.manager.activeNodes { for _, node := range h.manager.activeNodes {
err = h.manager.shutdownNode(node) err := h.manager.shutdownNode(node)
if err == nil { if err == nil {
continue continue
} }
@@ -446,9 +446,11 @@ func (h *HarnessTest) shutdownAllNodes() {
// is needed so other nodes can continue their shutdown // is needed so other nodes can continue their shutdown
// processes. // processes.
h.Logf("unable to shutdown %s, got err: %v", node.Name(), err) 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 // cleanupStandbyNode is a function should be called with defer whenever a