From ab370c0216cbb4134b83b2f087a074f9bacecf4a Mon Sep 17 00:00:00 2001 From: Mikio Hara Date: Thu, 15 May 2014 06:39:15 +0900 Subject: test: fix flakey test case for issue 4388 Seems like we need to drag the stack for :1 on Plan 9. See http://build.golang.org/log/283b996102b833dd81c58301d78aceaa4fe9838b. LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/95390043 --- test/fixedbugs/issue4388.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/fixedbugs/issue4388.go b/test/fixedbugs/issue4388.go index c8c53b710..2e052e138 100644 --- a/test/fixedbugs/issue4388.go +++ b/test/fixedbugs/issue4388.go @@ -43,8 +43,14 @@ func checkLine(n int) { if err := recover(); err == nil { panic("did not panic") } - _, file, line, _ := runtime.Caller(n) - if file != "" || line != 1 { - panic(fmt.Sprintf("expected :1 have %s:%d", file, line)) + var file string + var line int + for i := 1; i <= n; i++ { + _, file, line, _ = runtime.Caller(i) + if file != "" || line != 1 { + continue + } + return } + panic(fmt.Sprintf("expected :1 have %s:%d", file, line)) } -- cgit v1.2.1