rate: extend timing tolerances on Android and Plan9 Fixes #43055 Change-Id: I72a88ff9d031192911a90a607eaf0366575eb313 Reviewed-on: https://go-review.googlesource.com/c/time/+/387834 Reviewed-by: Sameer Ajmani <sameer@golang.org> Trust: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
diff --git a/rate/rate_test.go b/rate/rate_test.go index 1ca3711..57dd1a7 100644 --- a/rate/rate_test.go +++ b/rate/rate_test.go
@@ -437,10 +437,14 @@ // (The latter is surely less than half a d.) maxD := wantD switch runtime.GOOS { - case "netbsd", "openbsd": + case "netbsd", "openbsd", "android", "plan9": // NetBSD and OpenBSD tend to overshoot sleeps by a wide margin due to a // suspected platform bug; see https://go.dev/issue/44067 and // https://go.dev/issue/50189. + // + // Android and plan9 were empirically observed to overshoot too. + // Android might be trying to conserve power. + // For plan9, I (bcmills) am not sure what the problem would be. maxD = (wantD*3 + 1) / 2 // 150% of wantD, rounded up. } return gotD <= maxD