cli
cli copied to clipboard
unit tests never seed the RNG
meaning calls like h.NewFuncName() always return the same values. This can lead to data leaking between tests.
This shouldn't be a problem unless:
- tear down is not run completely
- you are using the same Fn instance for multiple concurrent runs of the tests
it should be safe to use a non-deterministic RNG (e.g. crypto/rand)
It comes up during the init-image tests as there is an init-image generated during the tests which gets called randName()-init, so it's the same on every test run. It's possible that one test run could fail to build that image and end up using an image from a previous run, but I'm not considering this a high priority really.