Made test more resilient to timing failures.