mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-30 07:35:07 +02:00
lntest: properly handle shutdown error
This commit removes the panic used in checking the shutdown log. Instead, the error is returned and asserted in `shutdownAllNodes` so it's easier to check which node failed in which test. We also catch all the errors returned from `StopDaemon` call to properly access the shutdown behavior.
This commit is contained in:
@@ -112,11 +112,14 @@ func (nm *nodeManager) registerNode(node *node.HarnessNode) {
|
||||
// ShutdownNode stops an active lnd process and returns when the process has
|
||||
// exited and any temporary directories have been cleaned up.
|
||||
func (nm *nodeManager) shutdownNode(node *node.HarnessNode) error {
|
||||
// Remove the node from the active nodes map even if the shutdown
|
||||
// fails as the shutdown cannot be retried in that case.
|
||||
delete(nm.activeNodes, node.Cfg.NodeID)
|
||||
|
||||
if err := node.Shutdown(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
delete(nm.activeNodes, node.Cfg.NodeID)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user