diff --git a/rpcserver_test.go b/rpcserver_test.go index 22484246..98c606e4 100644 --- a/rpcserver_test.go +++ b/rpcserver_test.go @@ -118,6 +118,13 @@ func TestMain(m *testing.M) { // purposes. if err := primaryHarness.SetUp(true, 25); err != nil { fmt.Println("unable to setup test chain: ", err) + + // Even though the harness was not fully setup, it still needs + // to be torn down to ensure all resources such as temp + // directories are cleaned up. The error is intentionally + // ignored since this is already an error path and nothing else + // could be done about it anyways. + _ = primaryHarness.TearDown() os.Exit(1) } diff --git a/rpctest/rpc_harness_test.go b/rpctest/rpc_harness_test.go index ebf8f052..0e777c6f 100644 --- a/rpctest/rpc_harness_test.go +++ b/rpctest/rpc_harness_test.go @@ -441,6 +441,13 @@ func TestMain(m *testing.M) { // 25 mature coinbases to allow spending from for testing purposes. if err = mainHarness.SetUp(true, numMatureOutputs); err != nil { fmt.Println("unable to setup test chain: ", err) + + // Even though the harness was not fully setup, it still needs + // to be torn down to ensure all resources such as temp + // directories are cleaned up. The error is intentionally + // ignored since this is already an error path and nothing else + // could be done about it anyways. + _ = mainHarness.TearDown() os.Exit(1) }