More flexible assertion in flaky test