fix race condition test failures