eleminate race conditions in unit tests