diff --git a/rpc/websocket_test.go b/rpc/websocket_test.go index 602b96746e..f53182256d 100644 --- a/rpc/websocket_test.go +++ b/rpc/websocket_test.go @@ -228,11 +228,9 @@ func wsPingTestHandler(t *testing.T, conn *websocket.Conn, shutdown, sendPing <- // Write messages. var ( - sendResponse <-chan time.Time wantPong string - timer *Timer + timer = time.NewTimer(0) ) - timer := time.NewTimer(0) defer timer.Stop() <-timer.C for { @@ -252,11 +250,9 @@ func wsPingTestHandler(t *testing.T, conn *websocket.Conn, shutdown, sendPing <- } wantPong = "" timer.Reset(200 * time.Millisecond) - sendResponse = timer.C - case <-sendResponse: + case <-timer.C: t.Logf("server sending response") conn.WriteMessage(websocket.TextMessage, []byte(subNotify)) - sendResponse = nil case <-shutdown: conn.Close() return