fix race condition when running tests in parallel