Fix test race condition.