Make test more reliably deterministic