mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime/pprof: make TestBlockProfile more robust
It's using debug mode of pprof.writeBlock, so the output actually goes through text/tabwriter. It is possible that tabwriter expands each tab into multiple tabs in certain cases. For example, this output has been observed on the new arm64 port: 10073805 1 @ 0x1088ec 0xd1b8c 0xd0628 0xb68c0 0x867f4 # 0x1088ec sync.(*Cond).Wait+0xfc /home/minux/go.git/src/sync/cond.go:63 # 0xd1b8c runtime/pprof_test.blockCond+0x22c /home/minux/go.git/src/runtime/pprof/pprof_test.go:454 # 0xd0628 runtime/pprof_test.TestBlockProfile+0x1b8 /home/minux/go.git/src/runtime/pprof/pprof_test.go:359 # 0xb68c0 testing.tRunner+0x140 /home/minux/go.git/src/testing/testing.go:447 10069965 1 @ 0x14008 0xd1390 0xd0628 0xb68c0 0x867f4 # 0x14008 runtime.chansend1+0x48 /home/minux/go.git/src/runtime/chan.go:76 # 0xd1390 runtime/pprof_test.blockChanSend+0x100 /home/minux/go.git/src/runtime/pprof/pprof_test.go:396 # 0xd0628 runtime/pprof_test.TestBlockProfile+0x1b8 /home/minux/go.git/src/runtime/pprof/pprof_test.go:359 # 0xb68c0 testing.tRunner+0x140 /home/minux/go.git/src/testing/testing.go:447 10069706 1 @ 0x108e0c 0xd193c 0xd0628 0xb68c0 0x867f4 # 0x108e0c sync.(*Mutex).Lock+0x19c /home/minux/go.git/src/sync/mutex.go:67 # 0xd193c runtime/pprof_test.blockMutex+0xbc /home/minux/go.git/src/runtime/pprof/pprof_test.go:441 # 0xd0628 runtime/pprof_test.TestBlockProfile+0x1b8 /home/minux/go.git/src/runtime/pprof/pprof_test.go:359 # 0xb68c0 testing.tRunner+0x140 /home/minux/go.git/src/testing/testing.go:447 Change-Id: I3bef778c5fe01a894cfdc526fdc5fecb873b8ade Signed-off-by: Shenghou Ma <minux@golang.org> Reviewed-on: https://go-review.googlesource.com/5554 Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
This commit is contained in:
parent
b48d2a5f25
commit
f0bbb5c450
1 changed files with 1 additions and 1 deletions
|
|
@ -375,7 +375,7 @@ func TestBlockProfile(t *testing.T) {
|
|||
}
|
||||
|
||||
for _, test := range tests {
|
||||
if !regexp.MustCompile(test.re).MatchString(prof) {
|
||||
if !regexp.MustCompile(strings.Replace(test.re, "\t", "\t+", -1)).MatchString(prof) {
|
||||
t.Fatalf("Bad %v entry, expect:\n%v\ngot:\n%v", test.name, test.re, prof)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue