aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/testdata
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2025-10-03 16:23:10 +0000
committerGopher Robot <gobot@golang.org>2025-10-06 12:27:36 -0700
commitac2ec82172799b88c057bb9ded6fe24e7909e860 (patch)
tree576511390dd0c38c2c6dfcd141ec3f7a4f88241f /src/runtime/testdata
parente74b224b7c7b7511fe37686d81a6e33d40fdeb17 (diff)
downloadgo-ac2ec82172799b88c057bb9ded6fe24e7909e860.tar.xz
runtime: bump thread count slack for TestReadMetricsSched
This test is *still* flaky, but it appears to be just mayMoreStackPreempt and the thread count *occasionally* exceeds the original (and arbitrary) thread count slack by exactly 1. Bump the thread count slack by one. We can investigate further and bump it again if it continues to be a problem. Fixes #75664. Change-Id: I29c922bba6d2cc99a8c3bf5e04cc512d0694f7fa Reviewed-on: https://go-review.googlesource.com/c/go/+/708868 Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/runtime/testdata')
-rw-r--r--src/runtime/testdata/testprog/schedmetrics.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/runtime/testdata/testprog/schedmetrics.go b/src/runtime/testdata/testprog/schedmetrics.go
index 6d3f68a848..bc0906330f 100644
--- a/src/runtime/testdata/testprog/schedmetrics.go
+++ b/src/runtime/testdata/testprog/schedmetrics.go
@@ -84,7 +84,12 @@ func SchedMetrics() {
// threadsSlack is the maximum number of threads left over
// from the runtime (sysmon, the template thread, etc.)
- const threadsSlack = 4
+ // Certain build modes may also cause the creation of additional
+ // threads through frequent scheduling, like mayMoreStackPreempt.
+ // A slack of 5 is arbitrary but appears to be enough to cover
+ // the leftovers plus any inflation from scheduling-heavy build
+ // modes.
+ const threadsSlack = 5
// Make sure GC isn't running, since GC workers interfere with
// expected counts.