From c1ccae4d149ac23b376d17fdef486e631a92f775 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 11 Oct 2019 11:39:30 -0700 Subject: [PATCH] os: deflake TestFdReadRace by increasing timeout This timeout will never be reached if the test passes, so it doesn't much matter how long it is. The test is t.Parallel so on a slow system 1 second may occasionally not be enough, although on my laptop the test takes about 0.02 seconds. Fixes #34431 Change-Id: Ia2184e6be3747933bfe83aa6c8e1f77e6b1e0bba Reviewed-on: https://go-review.googlesource.com/c/go/+/200764 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick Reviewed-by: Bryan C. Mills --- src/os/pipe_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/pipe_test.go b/src/os/pipe_test.go index 114c181c4a..2e93e3946a 100644 --- a/src/os/pipe_test.go +++ b/src/os/pipe_test.go @@ -428,7 +428,7 @@ func TestFdReadRace(t *testing.T) { go func() { defer wg.Done() var buf [10]byte - r.SetReadDeadline(time.Now().Add(time.Second)) + r.SetReadDeadline(time.Now().Add(time.Minute)) c <- true if _, err := r.Read(buf[:]); os.IsTimeout(err) { t.Error("read timed out")