Fix failure in test_unshare_project due to dropping handle outside of an update block
Co-Authored-By: Antonio Scandurra <me@as-cii.com> Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
co-authored by
Antonio Scandurra
Nathan Sobo
parent
efe7f61128
commit
2b64e8d4a2
@@ -1238,7 +1238,9 @@ mod tests {
|
|||||||
.condition(cx_b, |project, _| project.is_read_only())
|
.condition(cx_b, |project, _| project.is_read_only())
|
||||||
.await;
|
.await;
|
||||||
assert!(worktree_a.read_with(cx_a, |tree, _| !tree.as_local().unwrap().is_shared()));
|
assert!(worktree_a.read_with(cx_a, |tree, _| !tree.as_local().unwrap().is_shared()));
|
||||||
drop(project_b);
|
cx_b.update(|_| {
|
||||||
|
drop(project_b);
|
||||||
|
});
|
||||||
|
|
||||||
// Share the project again and ensure guests can still join.
|
// Share the project again and ensure guests can still join.
|
||||||
project_a
|
project_a
|
||||||
@@ -1247,7 +1249,7 @@ mod tests {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
assert!(worktree_a.read_with(cx_a, |tree, _| tree.as_local().unwrap().is_shared()));
|
assert!(worktree_a.read_with(cx_a, |tree, _| tree.as_local().unwrap().is_shared()));
|
||||||
|
|
||||||
let project_c = Project::remote(
|
let project_b2 = Project::remote(
|
||||||
project_id,
|
project_id,
|
||||||
client_b.clone(),
|
client_b.clone(),
|
||||||
client_b.user_store.clone(),
|
client_b.user_store.clone(),
|
||||||
@@ -1257,7 +1259,7 @@ mod tests {
|
|||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
project_c
|
project_b2
|
||||||
.update(cx_b, |p, cx| p.open_buffer((worktree_id, "a.txt"), cx))
|
.update(cx_b, |p, cx| p.open_buffer((worktree_id, "a.txt"), cx))
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user