Skip to content

Commit

Permalink
Fix incomplete progress bar assertions when panicking
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexendoo committed Jul 5, 2024
1 parent 482e3d9 commit 97555c3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/status_emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,10 @@ impl Text {
Msg::Inc => {
progress.as_ref().unwrap().inc(1);
}
Msg::Finish => return,
Msg::Finish => break 'outer,
},
Err(TryRecvError::Disconnected) => break 'outer,
// Sender panicked, skip asserts
Err(TryRecvError::Disconnected) => return,
Err(TryRecvError::Empty) => break,
}
}
Expand All @@ -245,7 +246,7 @@ impl Text {
progress.tick()
}
}
assert_eq!(threads.len(), 0);
assert_eq!(threads.len(), 0, "remaining: {threads:?}");
if let Some(progress) = progress {
progress.tick();
assert!(progress.is_finished());
Expand Down Expand Up @@ -323,9 +324,8 @@ impl TestStatus for TextTest {
if ProgressDrawTarget::stdout().is_hidden() {
println!("{old_msg} {msg}");
std::io::stdout().flush().unwrap();
} else {
self.text.sender.send(Msg::Pop(old_msg, Some(msg))).unwrap();
}
self.text.sender.send(Msg::Pop(old_msg, Some(msg))).unwrap();
}
}

Expand Down

0 comments on commit 97555c3

Please sign in to comment.