Skip to content

Commit d8e7ff2

Browse files
committed
this apparently needs more test rounds
1 parent 4d090d8 commit d8e7ff2

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

tests/pass/0weak_memory/weak.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,15 @@ fn check_all_outcomes<T: Eq + std::hash::Hash + std::fmt::Display>(
4444
let expected: HashSet<T> = HashSet::from_iter(expected);
4545
let mut seen = HashSet::new();
4646
// Let's give it N times as many tries as we are expecting values.
47-
let tries = expected.len() * 8;
48-
for _ in 0..tries {
47+
let tries = expected.len() * 12;
48+
for i in 0..tries {
4949
let val = generate();
5050
assert!(expected.contains(&val), "got an unexpected value: {val}");
5151
seen.insert(val);
52+
if i > tries / 2 && expected.len() == seen.len() {
53+
// We saw everything and we did quite a few tries, let's avoid wasting time.
54+
return;
55+
}
5256
}
5357
// Let's see if we saw them all.
5458
for val in expected {

tests/pass/float_nan.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,14 @@ fn check_all_outcomes<T: Eq + std::hash::Hash + fmt::Display>(
3838
let mut seen = HashSet::new();
3939
// Let's give it N times as many tries as we are expecting values.
4040
let tries = expected.len() * 12;
41-
for _ in 0..tries {
41+
for i in 0..tries {
4242
let val = generate();
4343
assert!(expected.contains(&val), "got an unexpected value: {val}");
4444
seen.insert(val);
45+
if i > tries / 2 && expected.len() == seen.len() {
46+
// We saw everything and we did quite a few tries, let's avoid wasting time.
47+
return;
48+
}
4549
}
4650
// Let's see if we saw them all.
4751
for val in expected {

0 commit comments

Comments
 (0)