lntest+itest: kill node and wait its process

Fix a flake found in `testRPCMiddlewareInterceptor` when running in
macOS.
This commit is contained in:
yyforyongyu committed 2024-11-12 23:55:40 +08:00
1 parent 90bca1022b
commit 2905e7b3df
3 files changed
+21 -9

No files matched your search

+3 -2
View File
@@ -841,9 +841,10 @@ func (h *HarnessTest) NewNodeRemoteSigner(name string, extraArgs []string,
return hn
}
// KillNode kills the node (but won't wait for the node process to stop).
// KillNode kills the node and waits for the node process to stop.
func (h *HarnessTest) KillNode(hn *node.HarnessNode) {
require.NoErrorf(h, hn.Kill(), "%s: kill got error", hn.Name())
h.Logf("Manually killing the node %s", hn.Name())
require.NoErrorf(h, hn.KillAndWait(), "%s: kill got error", hn.Name())
delete(h.manager.activeNodes, hn.Cfg.NodeID)
}