1
0
mirror of https://github.com/golang/go synced 2024-11-25 20:57:57 -07:00
go/test/chan
Josh Bleecher Snyder a1e7fb4eed test: deflake chan/select3.go
On a slow or distracted machine, 0.1s is sometimes
not long enough for a non-blocking function call to complete.
This causes rare test flakes.
They can be easily reproduced by reducing the wait time to (say) 100ns.

For non-blocking functions, increase the window from 100ms to 10s.
Using different windows for block and non-blocking functions,
allows us to reduce the time for blocking functions.
The risk here is false negatives, but that risk is low;
this test is run repeatedly on many fast machines,
for which 10ms is ample time.
This reduces the time required to run the test by a factor of 10,
from ~1s to ~100ms.

Fixes #20299

Change-Id: Ice9a641a66c6c101d738a2ebe1bcb144ae3c9916
Reviewed-on: https://go-review.googlesource.com/47812
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-07-08 02:10:12 +00:00
..
doubleselect.go test/chan: add missing flag.Parse in doubleselect.go 2017-04-24 01:34:14 +00:00
fifo.go test: gofmt chan/*.go 2017-05-18 22:35:07 +00:00
goroutines.go test/chan: document tests 2012-02-19 17:44:02 +11:00
nonblock.go test/chan: document tests 2012-02-19 17:44:02 +11:00
perm.go test: gofmt chan/*.go 2017-05-18 22:35:07 +00:00
powser1.go test: gofmt chan/*.go 2017-05-18 22:35:07 +00:00
powser2.go test: gofmt chan/*.go 2017-05-18 22:35:07 +00:00
select2.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
select3.go test: deflake chan/select3.go 2017-07-08 02:10:12 +00:00
select4.go test/chan: document tests 2012-02-19 17:44:02 +11:00
select5.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
select6.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
select7.go all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
select.go test/chan: document tests 2012-02-19 17:44:02 +11:00
sendstmt.go test: gofmt chan/*.go 2017-05-18 22:35:07 +00:00
sieve1.go test/chan: document tests 2012-02-19 17:44:02 +11:00
sieve2.go test/chan: document tests 2012-02-19 17:44:02 +11:00
zerosize.go test/chan: document tests 2012-02-19 17:44:02 +11:00