Fix profile test race condition