Commit c1ccae4d authored by Ian Lance Taylor's avatar Ian Lance Taylor

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 <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
parent fd33b2c9
...@@ -428,7 +428,7 @@ func TestFdReadRace(t *testing.T) { ...@@ -428,7 +428,7 @@ func TestFdReadRace(t *testing.T) {
go func() { go func() {
defer wg.Done() defer wg.Done()
var buf [10]byte var buf [10]byte
r.SetReadDeadline(time.Now().Add(time.Second)) r.SetReadDeadline(time.Now().Add(time.Minute))
c <- true c <- true
if _, err := r.Read(buf[:]); os.IsTimeout(err) { if _, err := r.Read(buf[:]); os.IsTimeout(err) {
t.Error("read timed out") t.Error("read timed out")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment