Fix up condition not checking the condition at the start.

Piotr Osiewicz and Antonio created

Co-authored-by: Antonio <antonio@zed.dev>

Change summary

crates/gpui2/src/app/test_context.rs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

Detailed changes

crates/gpui2/src/app/test_context.rs 🔗

@@ -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