mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
rpc/websocket_test : add timer var to make sure the timer finally stopped
This commit is contained in:
parent
e0971d47db
commit
9759ac7816
1 changed files with 3 additions and 6 deletions
|
|
@ -247,12 +247,9 @@ func wsPingTestHandler(t *testing.T, conn *websocket.Conn, shutdown, sendPing <-
|
|||
t.Errorf("got pong with wrong data %q", data)
|
||||
}
|
||||
wantPong = ""
|
||||
sendResponse = time.NewTimer(200 * time.Millisecond).C
|
||||
defer func() {
|
||||
if sendResponse != nil {
|
||||
sendResponse.Stop()
|
||||
}
|
||||
}()
|
||||
timer := time.NewTimer(200 * time.Millisecond)
|
||||
defer timer.Stop()
|
||||
sendResponse = timer.C
|
||||
case <-sendResponse:
|
||||
t.Logf("server sending response")
|
||||
conn.WriteMessage(websocket.TextMessage, []byte(subNotify))
|
||||
|
|
|
|||
Loading…
Reference in a new issue