Make sure next_scan_complete resolves

Sometimes the scan state could change so quickly that the consumer
wouldn't notice that it ever went to a scanning state before going back
to an idle state, hence never resolving.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra
2021-05-11 16:06:12 +02:00
co-authored by Nathan Sobo
parent ff5561d402
commit 02bd9c8420
3 changed files with 24 additions and 26 deletions
+2 -1
View File
@@ -3060,7 +3060,8 @@ mod tests {
tree.flush_fs_events(&app).await;
fs::remove_file(dir.path().join("file1")).unwrap();
app.read(|ctx| tree.read(ctx).next_scan_complete()).await;
tree.update(&mut app, |tree, ctx| tree.next_scan_complete(ctx))
.await;
model.update(&mut app, |buffer, _| {
assert_eq!(*events.borrow(), &[Event::FileHandleChanged]);