From 814a1fc1981dcfc8eac0d981065934aba95366a3 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Tue, 26 Nov 2024 22:15:35 +0800 Subject: [PATCH] rpctest: make sure to `WaitForShutdown` --- integration/rpctest/rpc_harness.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/integration/rpctest/rpc_harness.go b/integration/rpctest/rpc_harness.go index 0b85232868..0e8c53dbe9 100644 --- a/integration/rpctest/rpc_harness.go +++ b/integration/rpctest/rpc_harness.go @@ -303,10 +303,12 @@ func (h *Harness) SetUp(createTestChain bool, numMatureOutputs uint32) error { func (h *Harness) tearDown() error { if h.Client != nil { h.Client.Shutdown() + h.Client.WaitForShutdown() } if h.BatchClient != nil { h.BatchClient.Shutdown() + h.BatchClient.WaitForShutdown() } if err := h.node.shutdown(); err != nil { @@ -570,10 +572,10 @@ func NextAvailablePortForProcess(pid int) int { os.TempDir(), fmt.Sprintf("rpctest-port-pid-%d.lock", pid), ) timeout := time.After(time.Second) - + var ( lockFileHandle *os.File - err error + err error ) for { // Attempt to acquire the lock file. If it already exists, wait