ginkgo: Ginkgo panics when using the Table extension
see https://sunrise.ci.cf-app.com/pipelines/pivnet-resource/jobs/test/builds/135
[2] /tmp/ginkgo371214560/validator.test flag redefined: ginkgo.seed
[2] panic: /tmp/ginkgo371214560/validator.test flag redefined: ginkgo.seed
I see the same thing when locally when not running in parallel.
This is running golang 1.6 and I believe the behavior is not observed on golang 1.5 as I have used the Table extension in other projects on golang 1.5 without issue.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 21 (16 by maintainers)
Sigh… Go. The hackery that went into the vendor experiment continues to blindside people (also
flagsand ginkgo both use global state, so caveat emptor).OK this makes sense @robdimsdale - if
ginkgois vendored but/tableisn’t vendored and ginkgo happens to be under your$GOPATHthen go will pull in the package under$GOPATH/github.com/onsi/ginkgo/extensions/tablewhich will import the package under$GOPATH/github.com/onsi/ginkgowhich runs theinit()function and registers the flags globally.But go will pull in the
ginkgopackage for your test suite fromVENDOR_PATH/github.com/onsi/ginkgo. This will be a different package from the$GOPATHone and go will run it’sinit()function too (normally theinit()function for a package is only run once - but these are treated like two different packages).The two
init()s call theflagpackage to registerginkgo.seedsand kaboombizzare. i took your example and tried it on my machine running go 1.6 (brew installed) and it works for me… have you cleared your $GOPATH/pkg?