]> Cypherpunks repositories - gostls13.git/commitdiff
net: add even more timing slop for TestDialParallel
authorDamien Neil <dneil@google.com>
Tue, 24 May 2022 23:13:42 +0000 (16:13 -0700)
committerDamien Neil <dneil@google.com>
Wed, 25 May 2022 17:58:26 +0000 (17:58 +0000)
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>

src/net/dial_test.go

index 3cce444e5cfefa6a0330bcefcb76bd92ce4cf20c..afec31f636ec92e289501500687aaddb569ed723 100644 (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