MT#5751 avoid sleep statements in tests

this removes some of the sleeps in tests
the current state only runs without errors on phantomjs