diff --git a/protocol/chainlib/chainproxy/connector_test.go b/protocol/chainlib/chainproxy/connector_test.go index f031cd3528..1ad5a63abd 100644 --- a/protocol/chainlib/chainproxy/connector_test.go +++ b/protocol/chainlib/chainproxy/connector_test.go @@ -178,7 +178,6 @@ func TestHashing(t *testing.T) { func TestMain(m *testing.M) { listener := createRPCServer() - defer listener.Close() for { ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) _, err := rpcclient.DialContext(ctx, listenerAddressTcp) @@ -192,6 +191,6 @@ func TestMain(m *testing.M) { // Start running tests. code := m.Run() - + listener.Close() os.Exit(code) }