Skip to content

Commit 1e7b33e

Browse files
authored
chore: wait for EOF for longer duration (#83)
Fixes #82.
1 parent 232f27d commit 1e7b33e

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

internal/proxy/proxy_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,19 +270,14 @@ func TestClientLimitsMaxConnections(t *testing.T) {
270270
}
271271
defer conn2.Close()
272272

273-
// try to read to check if the connection is closed
274-
// wait only a second for the result (since nothing is writing to the
275-
// socket)
276-
conn2.SetReadDeadline(time.Now().Add(time.Second))
277-
278273
wantEOF := func(t *testing.T, c net.Conn) {
279274
var got error
280275
for i := 0; i < 10; i++ {
281276
_, got = c.Read(make([]byte, 1))
282277
if got == io.EOF {
283278
return
284279
}
285-
time.Sleep(500 * time.Millisecond)
280+
time.Sleep(time.Second)
286281
}
287282
t.Fatalf("conn.Read should return io.EOF, got = %v", got)
288283
}

0 commit comments

Comments
 (0)