Fixes flappy tests on mongodb