diff options
Diffstat (limited to 'src/runtime/pprof')
| -rw-r--r-- | src/runtime/pprof/pprof_test.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go index 99c5155806..25a2f3b324 100644 --- a/src/runtime/pprof/pprof_test.go +++ b/src/runtime/pprof/pprof_test.go @@ -117,10 +117,6 @@ func TestCPUProfileMultithreadMagnitude(t *testing.T) { t.Skip("issue 35057 is only confirmed on Linux") } - // Linux [5.9,5.16) has a kernel bug that can break CPU timers on newly - // created threads, breaking our CPU accounting. - major, minor := unix.KernelVersion() - t.Logf("Running on Linux %d.%d", major, minor) defer func() { if t.Failed() { t.Logf("Failure of this test may indicate that your system suffers from a known Linux kernel bug fixed on newer kernels. See https://golang.org/issue/49065.") @@ -131,9 +127,9 @@ func TestCPUProfileMultithreadMagnitude(t *testing.T) { // it enabled to potentially warn users that they are on a broken // kernel. if testenv.Builder() != "" && (runtime.GOARCH == "386" || runtime.GOARCH == "amd64") { - have59 := major > 5 || (major == 5 && minor >= 9) - have516 := major > 5 || (major == 5 && minor >= 16) - if have59 && !have516 { + // Linux [5.9,5.16) has a kernel bug that can break CPU timers on newly + // created threads, breaking our CPU accounting. + if unix.KernelVersionGE(5, 9) && !unix.KernelVersionGE(5, 16) { testenv.SkipFlaky(t, 49065) } } |
