From: Damien Neil Date: Tue, 24 May 2022 23:13:42 +0000 (-0700) Subject: net: add even more timing slop for TestDialParallel X-Git-Tag: go1.19beta1~119 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=757f3c802aaf3e01647e644ff7ee160af1751c63;p=gostls13.git 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 Reviewed-by: Bryan Mills Reviewed-by: Ian Lance Taylor TryBot-Result: Gopher Robot --- diff --git a/src/net/dial_test.go b/src/net/dial_test.go index 3cce444e5c..afec31f636 100644 --- a/src/net/dial_test.go +++ b/src/net/dial_test.go @@ -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