re PR go/64683 (FAIL: runtime/pprof -- testing.go:278: The entry did not match)
authorIan Lance Taylor <ian@gcc.gnu.org>
Tue, 20 Jan 2015 16:11:36 +0000 (16:11 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 20 Jan 2015 16:11:36 +0000 (16:11 +0000)
PR go/64683
runtime/pprof: Let memory profiler test pass if value not collected.

Since gccgo's GC is not precise, the transient value may not
be collected.  Let the regexp match that case as well.

From-SVN: r219900

libgo/go/runtime/pprof/mprof_test.go

index d4a948563c6e68369446e2260ec28cbe843177d5..44a385088262c37df1c912bf9cf23b779428be4c 100644 (file)
@@ -85,10 +85,12 @@ func TestMemoryProfiler(t *testing.T) {
 #      0x[0-9,a-f]+    runtime_pprof_test\.TestMemoryProfiler\+0x[0-9,a-f]+    .*/mprof_test.go:64
 `, (1<<10)*memoryProfilerRun, (1<<20)*memoryProfilerRun),
 
-               fmt.Sprintf(`0: 0 \[%v: %v\] @ 0x[0-9,a-f x]+
+               // This should start with "0: 0" but gccgo's imprecise
+               // GC means that sometimes the value is not collected.
+               fmt.Sprintf(`(0|%v): (0|%v) \[%v: %v\] @ 0x[0-9,a-f x]+
 #      0x[0-9,a-f]+    pprof_test\.allocateTransient2M\+0x[0-9,a-f]+   .*/mprof_test.go:30
 #      0x[0-9,a-f]+    runtime_pprof_test\.TestMemoryProfiler\+0x[0-9,a-f]+    .*/mprof_test.go:65
-`, memoryProfilerRun, (2<<20)*memoryProfilerRun),
+`, memoryProfilerRun, (2<<20)*memoryProfilerRun, memoryProfilerRun, (2<<20)*memoryProfilerRun),
        }
 
        for _, test := range tests {