}
func TestRuntimeLockMetricsAndProfile(t *testing.T) {
- testenv.SkipFlaky(t, 64253)
-
old := runtime.SetMutexProfileFraction(0) // enabled during sub-tests
defer runtime.SetMutexProfileFraction(old)
if old != 0 {
}
const slop = 1.5 // account for nanotime vs cputicks
- if profileGrowth > slop*metricGrowth || metricGrowth > slop*profileGrowth {
- t.Errorf("views differ by more than %fx", slop)
- }
+ t.Run("compare timers", func(t *testing.T) {
+ testenv.SkipFlaky(t, 64253)
+ if profileGrowth > slop*metricGrowth || metricGrowth > slop*profileGrowth {
+ t.Errorf("views differ by more than %fx", slop)
+ }
+ })
})
t.Run("sample-2", func(t *testing.T) {
+ testenv.SkipFlaky(t, 64253)
+
old := runtime.SetMutexProfileFraction(2)
defer runtime.SetMutexProfileFraction(old)
})
t.Run("runtime.semrelease", func(t *testing.T) {
+ testenv.SkipFlaky(t, 64253)
+
old := runtime.SetMutexProfileFraction(1)
defer runtime.SetMutexProfileFraction(old)