Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
denopink committed Apr 2, 2024
1 parent 54bb265 commit ad58af4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/websocket/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ func TestEndToEnd(t *testing.T) {
c.Close(websocket.StatusNormalClosure, "")
}))
defer s.Close()
// Give our test server a few seconds to start.
// Otherwise, our websocket will get a "failed to WebSocket dial: failed to send handshake request: Get \"http://127.0.0.1:52644\":
// dial tcp6: address 127.0.0.1: no suitable address found" error
time.Sleep(2000 * time.Millisecond)

var msgCnt, connectCnt, disconnectCnt atomic.Int64

Expand Down Expand Up @@ -110,7 +114,7 @@ func TestEndToEnd(t *testing.T) {
// Allow multiple calls to start.
got.Start()

ctx, cancel := context.WithTimeout(context.Background(), 2000*time.Millisecond)
ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond)
defer cancel()

for {
Expand Down

0 comments on commit ad58af4

Please sign in to comment.