Fix up condition not checking the condition at the start.

Co-authored-by: Antonio <antonio@zed.dev>
This commit is contained in:
Piotr Osiewicz
2023-12-04 15:31:35 +01:00
co-authored by Antonio
parent 24b08921fe
commit b9a917f42a
+5 -2
View File
@@ -343,12 +343,15 @@ impl TestAppContext {
use smol::future::FutureExt as _;
async {
while notifications.next().await.is_some() {
loop {
if model.update(self, &mut predicate) {
return Ok(());
}
if notifications.next().await.is_none() {
bail!("model dropped")
}
}
bail!("model dropped")
}
.race(timer.map(|_| Err(anyhow!("condition timed out"))))
.await