Fixes nightly buildbot

* Makes the test more robust