net: add even more timing slop for TestDialParallel

This test expects dials of a closed port to complete in about the same
amount of time: an initial probe value +/- 20%. Reduce test flakes on
Windows by increasing the slop to +/- 50% of the original value.

Fixes #52173

Change-Id: I813492c36aca2b0264b3b5b8c96e8bf97193af76
Reviewed-on: https://go-review.googlesource.com/c/go/+/408354
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Damien Neil 2022-05-24 16:13:42 -07:00
parent 78b722d8c2
commit 757f3c802a
1 changed files with 2 additions and 2 deletions

View File

@ -302,8 +302,8 @@ func TestDialParallel(t *testing.T) {
// We used to always use 95 milliseconds as the slop,
// but that was flaky on Windows. See issue 35616.
slop := 95 * time.Millisecond
if fifth := tt.expectElapsed / 5; fifth > slop {
slop = fifth
if half := tt.expectElapsed / 2; half > slop {
slop = half
}
expectElapsedMin := tt.expectElapsed - slop
expectElapsedMax := tt.expectElapsed + slop