From 700478e6f8635d70f3e19eb8de70b5b419fac90a Mon Sep 17 00:00:00 2001 From: behzad nouri Date: Mon, 25 Jan 2021 15:57:46 +0000 Subject: [PATCH] fixes test_filter_current flakiness (#14816) (cherry picked from commit d1df9da7d38250cc702367d3592b381831fd1250) --- core/src/crds_value.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/crds_value.rs b/core/src/crds_value.rs index 85c2ed17e2..dd95bcfa4a 100644 --- a/core/src/crds_value.rs +++ b/core/src/crds_value.rs @@ -845,8 +845,11 @@ mod test { match value.wallclock().cmp(¤t_value.wallclock()) { Ordering::Less => (), Ordering::Equal => { - assert_eq!(value, *current_value); - count += 1; + // There is a chance that two randomly generated + // crds-values have the same label and wallclock. + if value == *current_value { + count += 1; + } } Ordering::Greater => panic!("this should not happen!"), }