From 0a81d31b66566cc62f028825612b9c1c858870ef Mon Sep 17 00:00:00 2001 From: David Crawshaw Date: Sat, 11 Apr 2015 19:04:25 -0400 Subject: [PATCH] runtime/pprof: skip fork test on darwin/arm64 Just like darwin/arm. Change-Id: Ic75927bd6457d37cda7dd8279fd9b4cd52edc1d1 Reviewed-on: https://go-review.googlesource.com/8813 Reviewed-by: Minux Ma --- src/runtime/pprof/pprof_test.go | 10 +++++++--- src/runtime/pprof/trace_test.go | 5 +++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go index 65d0a0aa8e..0189f457a7 100644 --- a/src/runtime/pprof/pprof_test.go +++ b/src/runtime/pprof/pprof_test.go @@ -122,7 +122,10 @@ func parseProfile(t *testing.T, bytes []byte, f func(uintptr, []uintptr)) { func testCPUProfile(t *testing.T, need []string, f func()) { switch runtime.GOOS { case "darwin": - if runtime.GOARCH != "arm" { + switch runtime.GOARCH { + case "arm", "arm64": + // nothing + default: out, err := exec.Command("uname", "-a").CombinedOutput() if err != nil { t.Fatal(err) @@ -207,8 +210,9 @@ func testCPUProfile(t *testing.T, need []string, f func()) { // Ensure that we do not do this. func TestCPUProfileWithFork(t *testing.T) { if runtime.GOOS == "darwin" { - if runtime.GOARCH == "arm" { - t.Skipf("skipping on darwin/arm") + switch runtime.GOARCH { + case "arm", "arm64": + t.Skipf("skipping on %s/%s, cannot fork", runtime.GOOS, runtime.GOARCH) } } diff --git a/src/runtime/pprof/trace_test.go b/src/runtime/pprof/trace_test.go index 2b85e47993..ca22a0dd27 100644 --- a/src/runtime/pprof/trace_test.go +++ b/src/runtime/pprof/trace_test.go @@ -21,6 +21,11 @@ func skipTraceTestsIfNeeded(t *testing.T) { switch runtime.GOOS { case "solaris": t.Skip("skipping: solaris timer can go backwards (http://golang.org/issue/8976)") + case "darwin": + switch runtime.GOARCH { + case "arm", "arm64": + t.Skipf("skipping on %s/%s, cannot fork", runtime.GOOS, runtime.GOARCH) + } } switch runtime.GOARCH {