From d1df9da7d38250cc702367d3592b381831fd1250 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) --- 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 aa0c891dc3..a0de54a7b0 100644 --- a/core/src/crds_value.rs +++ b/core/src/crds_value.rs @@ -870,8 +870,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!"), }