]> Cypherpunks repositories - gostls13.git/commit
time: use longer delta duration for TestAfterQueueing retries
authorMatthew Dempsky <mdempsky@google.com>
Wed, 29 Apr 2015 20:36:34 +0000 (13:36 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 29 Apr 2015 21:43:29 +0000 (21:43 +0000)
commitd12b532265603bdb2ce2fcb4bc3a53c03771d370
tree7d60afd737cff19ae32cc5839df7e0d7b8fde57a
parent3eed422fd13b56b978c610a0b9e69cf4a2c21b24
time: use longer delta duration for TestAfterQueueing retries

The TestAfterQueueing test is inherently flaky because it relies on
independent kernel threads being scheduled within the "delta" duration
of each other.  Normally, delta is 100ms but during "short" testing,
it's reduced to 20ms.

On at least OpenBSD, the CPU scheduler operates in 10ms time slices,
so high system load (e.g., from running multiple Go unit tests in
parallel, as happens during all.bash) can occasionally cause >20ms
scheduling delays and result in test flaking.  This manifests as issue
9903, which is the currently the most common OpenBSD flake.

To mitigate this delay, only reduce the delta duration to 20ms for the
first attempt during short testing.  If this fails and the test is
reattempted, subsequent attempts instead use a full 100ms delta.

Fixes #9903.

Change-Id: I11bdfa939e5be915f67ffad8a8aef6ed8772159a
Reviewed-on: https://go-review.googlesource.com/9510
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/time/sleep_test.go