From: Michael Munday Date: Tue, 22 Nov 2016 20:39:51 +0000 (-0500) Subject: runtime/pprof/internal/protopprof: fix test on s390x X-Git-Tag: go1.8beta1~69 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5508561180950534fd623fb61a8a8f357ad50e4c;p=gostls13.git 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 --- 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