Fix up condition not checking the condition at the start.
Co-authored-by: Antonio <antonio@zed.dev>
This commit is contained in:
co-authored by
Antonio
parent
24b08921fe
commit
b9a917f42a
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user