Skip to content

Commit 7fd5322

Browse files
committed
Improve tests (and maybe more) to assure parallel worktree tests are deterministic
At least so that tests deal with hardly avoidable non-determinism and there are no spurious failures.
1 parent 41139d8 commit 7fd5322

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

gix-worktree/tests/worktree/checkout.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ fn keep_going_collects_results() {
256256
opts,
257257
"make_mixed_without_submodules",
258258
|_id| {
259-
dbg!(_id);
260259
!matches!(
261260
count.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |current| {
262261
(current < 2).then_some(current + 1)
@@ -292,10 +291,11 @@ fn keep_going_collects_results() {
292291

293292
if multi_threaded() {
294293
let actual = dir_structure(&destination);
295-
if actual.len() != 3 {
296-
dbg!(destination.into_path());
297-
}
298-
assert_eq!(actual.len(), 3);
294+
assert!(
295+
(2..=3).contains(&actual.len()),
296+
"it's 3 most of the time, but can be 2 of the 'empty' file is missing as the object couldn't be accessed.\
297+
It's unclear why there isn't more, as it would keep going"
298+
);
299299
} else {
300300
assert_eq!(
301301
stripped_prefix(&destination, &dir_structure(&destination)),
@@ -481,7 +481,6 @@ fn checkout_index_in_tmp_dir_opts(
481481
if allow_return_object(oid) {
482482
odb.find_blob(oid, buf)
483483
} else {
484-
dbg!(oid);
485484
Err(gix_odb::find::existing_object::Error::NotFound { oid: oid.to_owned() })
486485
}
487486
},

0 commit comments

Comments
 (0)