rpc/server: properly shutdown things in subscription test
Chain is the last one to Close().
This commit is contained in:
parent
d4d8238e91
commit
23fb5dd420
1 changed files with 2 additions and 2 deletions
|
@ -89,11 +89,11 @@ func TestSubscriptions(t *testing.T) {
|
||||||
var subFeeds = []string{"block_added", "transaction_added", "notification_from_execution", "transaction_executed", "notary_request_event"}
|
var subFeeds = []string{"block_added", "transaction_added", "notification_from_execution", "transaction_executed", "notary_request_event"}
|
||||||
|
|
||||||
chain, rpcSrv, c, respMsgs, finishedFlag := initCleanServerAndWSClient(t)
|
chain, rpcSrv, c, respMsgs, finishedFlag := initCleanServerAndWSClient(t)
|
||||||
|
defer chain.Close()
|
||||||
|
defer func() { _ = rpcSrv.Shutdown() }()
|
||||||
|
|
||||||
go rpcSrv.coreServer.Start(make(chan error))
|
go rpcSrv.coreServer.Start(make(chan error))
|
||||||
defer rpcSrv.coreServer.Shutdown()
|
defer rpcSrv.coreServer.Shutdown()
|
||||||
defer chain.Close()
|
|
||||||
defer func() { _ = rpcSrv.Shutdown() }()
|
|
||||||
|
|
||||||
for _, feed := range subFeeds {
|
for _, feed := range subFeeds {
|
||||||
s := callSubscribe(t, c, respMsgs, fmt.Sprintf(`["%s"]`, feed))
|
s := callSubscribe(t, c, respMsgs, fmt.Sprintf(`["%s"]`, feed))
|
||||||
|
|
Loading…
Add table
Reference in a new issue