Another race condition fix in test