]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/pprof/internal/protopprof: fix test on s390x
authorMichael Munday <munday@ca.ibm.com>
Tue, 22 Nov 2016 20:39:51 +0000 (15:39 -0500)
committerMichael Munday <munday@ca.ibm.com>
Tue, 22 Nov 2016 20:57:16 +0000 (20:57 +0000)
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 <munday@ca.ibm.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/runtime/pprof/internal/protopprof/protomemprofile_test.go

index 65f93d6f1a630a8199bc04dd82fed590afe0feb5..a10fe772ccfbccc09301d900454ff7e04332e662 100644 (file)
@@ -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