mirror of
https://github.com/btcsuite/btcd.git
synced 2026-08-20 13:27:31 +02:00
rpctest: make sure to WaitForShutdown
This commit is contained in:
parent
25c804f13f
commit
814a1fc198
1 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue