Commit b4bc7b44 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

time: deflake TestAfterQueuing

Ramp up the delay on subsequent attempts. Fast builders have the same delay.

Not a perfect fix, but should make it better. And this easy.

Fixes #9903 maybe
Fixes #10680 maybe

Change-Id: I967380c2cb8196e6da9a71116961229d37b36335
Reviewed-on: https://go-review.googlesource.com/9795Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
parent ec87dbf9
...@@ -223,13 +223,10 @@ func TestAfterStop(t *testing.T) { ...@@ -223,13 +223,10 @@ func TestAfterStop(t *testing.T) {
func TestAfterQueuing(t *testing.T) { func TestAfterQueuing(t *testing.T) {
// This test flakes out on some systems, // This test flakes out on some systems,
// so we'll try it a few times before declaring it a failure. // so we'll try it a few times before declaring it a failure.
const attempts = 3 const attempts = 5
err := errors.New("!=nil") err := errors.New("!=nil")
for i := 0; i < attempts && err != nil; i++ { for i := 0; i < attempts && err != nil; i++ {
delta := 100 * Millisecond delta := Duration(20+i*50) * Millisecond
if i == 0 && testing.Short() {
delta = 20 * Millisecond
}
if err = testAfterQueuing(t, delta); err != nil { if err = testAfterQueuing(t, delta); err != nil {
t.Logf("attempt %v failed: %v", i, err) t.Logf("attempt %v failed: %v", i, err)
} }
......
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