From 23fb5dd4208f176f13154eaa5cef3d71a1fe914a Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 7 Jul 2021 20:47:34 +0300 Subject: [PATCH] rpc/server: properly shutdown things in subscription test Chain is the last one to Close(). --- pkg/rpc/server/subscription_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/rpc/server/subscription_test.go b/pkg/rpc/server/subscription_test.go index a2c1bdef2..45f08fd23 100644 --- a/pkg/rpc/server/subscription_test.go +++ b/pkg/rpc/server/subscription_test.go @@ -89,11 +89,11 @@ func TestSubscriptions(t *testing.T) { var subFeeds = []string{"block_added", "transaction_added", "notification_from_execution", "transaction_executed", "notary_request_event"} chain, rpcSrv, c, respMsgs, finishedFlag := initCleanServerAndWSClient(t) + defer chain.Close() + defer func() { _ = rpcSrv.Shutdown() }() go rpcSrv.coreServer.Start(make(chan error)) defer rpcSrv.coreServer.Shutdown() - defer chain.Close() - defer func() { _ = rpcSrv.Shutdown() }() for _, feed := range subFeeds { s := callSubscribe(t, c, respMsgs, fmt.Sprintf(`["%s"]`, feed))