rpc/server: properly shutdown things in subscription test

Chain is the last one to Close().
This commit is contained in:
Roman Khimov 2021-07-07 20:47:34 +03:00
parent d4d8238e91
commit 23fb5dd420

View file

@ -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))