additional race condition fixes in tests