go/src/internal
Austin Clements e3ba0977be internal/singleflight: deflake TestDoDupSuppress
Currently TestDoDupSuppress can fail if the goroutines created by its
loop run sequentially. This is rare, but it has caused failures on the
dashboard and in stress testing.

While I think there's no way to eliminate all possible thread
schedules that could make this test fail because it depends on waiting
until a Group.Do blocks, it is possible to make it much more robust.

This commit deflakes this test by forcing at least one invocation of
fn to start and all goroutines to reach the line just before the Do
call before allowing fn to proceed. fn then waits 10 milliseconds
before returning to allow the goroutines to pass through the Do.

With this change, in 50,000 runs of the stress testing configuration,
the number of calls to fn never even exceeded 1.

Fixes #11784.

Change-Id: Ie5adf5764545050ec407619769a656251c4cff04
Reviewed-on: https://go-review.googlesource.com/12681
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-26 20:35:09 +00:00
..
format go/format: fix //line corner case when formatting statements 2015-06-24 21:45:49 +00:00
singleflight internal/singleflight: deflake TestDoDupSuppress 2015-07-26 20:35:09 +00:00
syscall Revert "net, internal/syscall/unix: add SocketConn, SocketPacketConn" 2015-07-02 16:11:03 +00:00
testenv internal/testenv: skip network tests only when -short is specified 2015-06-18 21:10:44 +00:00
trace internal/trace: fix fuzzer crashers 2015-07-18 19:51:50 +00:00