aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/crash_cgo_test.go3
-rw-r--r--src/runtime/pprof/pprof_test.go23
2 files changed, 4 insertions, 22 deletions
diff --git a/src/runtime/crash_cgo_test.go b/src/runtime/crash_cgo_test.go
index a7321f49a5..83ac0a3d5e 100644
--- a/src/runtime/crash_cgo_test.go
+++ b/src/runtime/crash_cgo_test.go
@@ -78,6 +78,9 @@ func TestCgoCallbackPprof(t *testing.T) {
case "plan9", "windows":
t.Skipf("no pthreads on %s", runtime.GOOS)
}
+ if testenv.CPUProfilingBroken() {
+ t.Skip("skipping on platform with broken profiling")
+ }
got := runTestProg(t, "testprogcgo", "CgoCallbackPprof")
if want := "OK\n"; got != want {
diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go
index bba66ba48f..8a1d8e2d1f 100644
--- a/src/runtime/pprof/pprof_test.go
+++ b/src/runtime/pprof/pprof_test.go
@@ -416,27 +416,6 @@ func parseProfile(t *testing.T, valBytes []byte, f func(uintptr, []*profile.Loca
return p
}
-func cpuProfilingBroken() bool {
- switch runtime.GOOS {
- case "plan9":
- // Profiling unimplemented.
- return true
- case "aix":
- // See https://golang.org/issue/45170.
- return true
- case "ios", "dragonfly", "netbsd", "illumos", "solaris":
- // See https://golang.org/issue/13841.
- return true
- case "openbsd":
- if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" {
- // See https://golang.org/issue/13841.
- return true
- }
- }
-
- return false
-}
-
// testCPUProfile runs f under the CPU profiler, checking for some conditions specified by need,
// as interpreted by matches, and returns the parsed profile.
func testCPUProfile(t *testing.T, matches profileMatchFunc, f func(dur time.Duration)) *profile.Profile {
@@ -454,7 +433,7 @@ func testCPUProfile(t *testing.T, matches profileMatchFunc, f func(dur time.Dura
t.Skip("skipping on wasip1")
}
- broken := cpuProfilingBroken()
+ broken := testenv.CPUProfilingBroken()
deadline, ok := t.Deadline()
if broken || !ok {