fix race conditions in test suite