]> Cypherpunks repositories - gostls13.git/commit
runtime: make TestCPUMetricsSleep even more lenient
authorMichael Anthony Knyszek <mknyszek@google.com>
Fri, 26 May 2023 17:56:39 +0000 (17:56 +0000)
committerMichael Knyszek <mknyszek@google.com>
Wed, 31 May 2023 15:17:38 +0000 (15:17 +0000)
commit125c2cac642c4feacfc7d98a52f2287646d03fc7
tree7b6462a8d2057c2af7a5f4190e77d58a376fe924
parentd59926ec7e5bf709265afc17680ef720e9110696
runtime: make TestCPUMetricsSleep even more lenient

This test was introduced as a regression test for #60276. However, it
was quite flaky on a number of different platforms because there are
myriad ways the runtime can eat into time one might expect is completely
idle.

This change re-enables the test, but makes it much more resilient.
Because the issue we're testing for is persistent, we now require 10
consecutive failures to count. Any single success counts as a test
success. This change also makes the test's idle time bound more lenient,
allowing for a little bit of time to be eaten up. The regression we're
testing for results in nearly zero idle time being accounted for.

If this is still not good enough to eliminate flakes, this test should
just be deleted.

For #60276.
Fixes #60376.

Change-Id: Icd81f0c9970821b7f386f6d27c8a566fee4d0ff7
Reviewed-on: https://go-review.googlesource.com/c/go/+/498274
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/runtime/metrics_test.go