rpcsrv: enforce WS connection close on test cleanup
Do not wait until wsReader routine gracefully finishes its work before WS connection close. Instead, firstly close the connection, and after that wait for proper wsReader exit. It's a harsh way, but I don't have any other options to try, because wsReader routine hangs on `ws.ReadMessage()` operation for more than ReadDeadline (more than 5 seconds) during test cleanup which results in the test timeout. Close #3378. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
parent
22af33a14e
commit
e5c919f701
1 changed files with 1 additions and 1 deletions
|
@ -100,8 +100,8 @@ func initCleanServerAndWSClient(t *testing.T, startNetworkServer ...bool) (*core
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
close(readerStopCh)
|
close(readerStopCh)
|
||||||
<-readerToExitCh
|
|
||||||
ws.Close()
|
ws.Close()
|
||||||
|
<-readerToExitCh
|
||||||
if len(startNetworkServer) != 0 && startNetworkServer[0] {
|
if len(startNetworkServer) != 0 && startNetworkServer[0] {
|
||||||
rpcSrv.coreServer.Shutdown()
|
rpcSrv.coreServer.Shutdown()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue