Fix potentially flacky test