diff options
author | Mikio Hara <mikioh.mikioh@gmail.com> | 2014-05-15 06:39:15 +0900 |
---|---|---|
committer | Mikio Hara <mikioh.mikioh@gmail.com> | 2014-05-15 06:39:15 +0900 |
commit | ab370c0216cbb4134b83b2f087a074f9bacecf4a (patch) | |
tree | c341f882f864d819ea3eedba9c2b6f2002b57933 /test | |
parent | c2847f8a61cec8bbc914ab632cec25034219e4c0 (diff) | |
download | go-ab370c0216cbb4134b83b2f087a074f9bacecf4a.tar.gz |
test: fix flakey test case for issue 4388
Seems like we need to drag the stack for <autogenerated>:1 on Plan 9.
See http://build.golang.org/log/283b996102b833dd81c58301d78aceaa4fe9838b.
LGTM=rsc
R=rsc
CC=golang-codereviews
https://codereview.appspot.com/95390043
Diffstat (limited to 'test')
-rw-r--r-- | test/fixedbugs/issue4388.go | 12 |
1 files changed, 9 insertions, 3 deletions
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 != "<autogenerated>" || line != 1 { - panic(fmt.Sprintf("expected <autogenerated>: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 != "<autogenerated>" || line != 1 { + continue + } + return } + panic(fmt.Sprintf("expected <autogenerated>:1 have %s:%d", file, line)) } |