mirror of https://github.com/golang/go.git
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://golang.org/cl/95390043
This commit is contained in:
parent
1476686cdb
commit
147a21456e
|
|
@ -43,8 +43,14 @@ func checkLine(n int) {
|
||||||
if err := recover(); err == nil {
|
if err := recover(); err == nil {
|
||||||
panic("did not panic")
|
panic("did not panic")
|
||||||
}
|
}
|
||||||
_, file, line, _ := runtime.Caller(n)
|
var file string
|
||||||
if file != "<autogenerated>" || line != 1 {
|
var line int
|
||||||
panic(fmt.Sprintf("expected <autogenerated>:1 have %s:%d", file, line))
|
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))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue