Skip to content

Commit ac2ec82

Browse files
mknyszekgopherbot
authored andcommitted
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 golang#75664. Change-Id: I29c922bba6d2cc99a8c3bf5e04cc512d0694f7fa Reviewed-on: https://go-review.googlesource.com/c/go/+/708868 Reviewed-by: Michael Pratt <[email protected]> Auto-Submit: Michael Knyszek <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent e74b224 commit ac2ec82

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/runtime/testdata/testprog/schedmetrics.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,12 @@ func SchedMetrics() {
8484

8585
// threadsSlack is the maximum number of threads left over
8686
// from the runtime (sysmon, the template thread, etc.)
87-
const threadsSlack = 4
87+
// Certain build modes may also cause the creation of additional
88+
// threads through frequent scheduling, like mayMoreStackPreempt.
89+
// A slack of 5 is arbitrary but appears to be enough to cover
90+
// the leftovers plus any inflation from scheduling-heavy build
91+
// modes.
92+
const threadsSlack = 5
8893

8994
// Make sure GC isn't running, since GC workers interfere with
9095
// expected counts.

0 commit comments

Comments
 (0)