Initialize the random generator globally with a fixed seed instead (as a global variable) and use it all your tests. Otherwise, tests are not deterministic and may not be reproducible.