fixes test_filter_current flakiness (#14816)

This commit is contained in:
behzad nouri 2021-01-25 15:57:46 +00:00 committed by GitHub
parent 5700e835ef
commit d1df9da7d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -870,8 +870,11 @@ mod test {
match value.wallclock().cmp(&current_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!"),
}