Fix race conditions in test