From 99a174f06e6c7043a2ec739d116f6663f6c0c7b2 Mon Sep 17 00:00:00 2001 From: Damien Neil Date: Thu, 24 Aug 2023 10:12:38 -0700 Subject: [PATCH] net/http: remove arbitrary timeout from TestTransportGCRequest This test expects a *Request to be garbage collected within five seconds. Some slow builders take longer. Drop the arbitrary timeout. Fixes #56809 Change-Id: I4b5bdce09002a5b52b7b5d0b33e7876d48740bc3 Reviewed-on: https://go-review.googlesource.com/c/go/+/522615 Reviewed-by: Bryan Mills Run-TryBot: Damien Neil TryBot-Result: Gopher Robot --- src/net/http/clientserver_test.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/net/http/clientserver_test.go b/src/net/http/clientserver_test.go index 58321532ea4..32948f3aed4 100644 --- a/src/net/http/clientserver_test.go +++ b/src/net/http/clientserver_test.go @@ -1172,16 +1172,12 @@ func testTransportGCRequest(t *testing.T, mode testMode, body bool) { t.Fatal(err) } })() - timeout := time.NewTimer(5 * time.Second) - defer timeout.Stop() for { select { case <-didGC: return - case <-time.After(100 * time.Millisecond): + case <-time.After(1 * time.Millisecond): runtime.GC() - case <-timeout.C: - t.Fatal("never saw GC of request") } } }