From 5508561180950534fd623fb61a8a8f357ad50e4c Mon Sep 17 00:00:00 2001 From: Michael Munday Date: Tue, 22 Nov 2016 15:39:51 -0500 Subject: [PATCH] runtime/pprof/internal/protopprof: fix test on s390x Applies the fix from CL 32920 to the new test TestSampledHeapAllocProfile introduced in CL 33422. The test should be skipped rather than fail if there is only one executable region of memory. Updates #17852. Change-Id: Id8c47b1f17ead14f02a58a024c9a04ebb8ec0429 Reviewed-on: https://go-review.googlesource.com/33453 Run-TryBot: Michael Munday Reviewed-by: Ian Lance Taylor TryBot-Result: Gobot Gobot --- src/runtime/pprof/internal/protopprof/protomemprofile_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/runtime/pprof/internal/protopprof/protomemprofile_test.go b/src/runtime/pprof/internal/protopprof/protomemprofile_test.go index 65f93d6f1a..a10fe772cc 100644 --- a/src/runtime/pprof/internal/protopprof/protomemprofile_test.go +++ b/src/runtime/pprof/internal/protopprof/protomemprofile_test.go @@ -32,7 +32,9 @@ func TestSampledHeapAllocProfile(t *testing.T) { t.Fatalf("Cannot parse /proc/self/maps") } if len(mprof.Mapping) < 2 { - t.Fatalf("Less than two mappings") + // It is possible for a binary to only have 1 executable + // region of memory. + t.Skipf("need 2 or more mappings, got %v", len(mprof.Mapping)) } address1 := mprof.Mapping[0].Start address2 := mprof.Mapping[1].Start -- 2.50.0