From 1e7b33ec22d3d3bccd766125d78cd6ea9b35497b Mon Sep 17 00:00:00 2001 From: Eno Compton Date: Tue, 26 Jul 2022 14:04:12 -0600 Subject: [PATCH] chore: wait for EOF for longer duration (#83) Fixes #82. --- internal/proxy/proxy_test.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/internal/proxy/proxy_test.go b/internal/proxy/proxy_test.go index 8c6bab13..2f11b377 100644 --- a/internal/proxy/proxy_test.go +++ b/internal/proxy/proxy_test.go @@ -270,11 +270,6 @@ func TestClientLimitsMaxConnections(t *testing.T) { } defer conn2.Close() - // try to read to check if the connection is closed - // wait only a second for the result (since nothing is writing to the - // socket) - conn2.SetReadDeadline(time.Now().Add(time.Second)) - wantEOF := func(t *testing.T, c net.Conn) { var got error for i := 0; i < 10; i++ { @@ -282,7 +277,7 @@ func TestClientLimitsMaxConnections(t *testing.T) { if got == io.EOF { return } - time.Sleep(500 * time.Millisecond) + time.Sleep(time.Second) } t.Fatalf("conn.Read should return io.EOF, got = %v", got) }