Forbid parking earlier in server integration tests

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2021-08-20 16:41:10 +02:00
parent 98f691d16d
commit f463b2ed50

View File

@ -1054,6 +1054,7 @@ mod tests {
mut cx_b: TestAppContext,
mut cx_c: TestAppContext,
) {
cx_a.foreground().forbid_parking();
let lang_registry = Arc::new(LanguageRegistry::new());
// Connect to a server as 3 clients.
@ -1062,8 +1063,6 @@ mod tests {
let (_, client_b) = server.create_client(&mut cx_b, "user_b").await;
let (_, client_c) = server.create_client(&mut cx_c, "user_c").await;
cx_a.foreground().forbid_parking();
let fs = Arc::new(FakeFs::new());
// Share a worktree as client A.
@ -1196,6 +1195,7 @@ mod tests {
#[gpui::test]
async fn test_buffer_conflict_after_save(mut cx_a: TestAppContext, mut cx_b: TestAppContext) {
cx_a.foreground().forbid_parking();
let lang_registry = Arc::new(LanguageRegistry::new());
// Connect to a server as 2 clients.
@ -1203,8 +1203,6 @@ mod tests {
let (_, client_a) = server.create_client(&mut cx_a, "user_a").await;
let (_, client_b) = server.create_client(&mut cx_b, "user_b").await;
cx_a.foreground().forbid_parking();
// Share a local worktree as client A
let fs = Arc::new(FakeFs::new());
fs.save(Path::new("/a.txt"), &"a-contents".into())
@ -1278,6 +1276,7 @@ mod tests {
mut cx_a: TestAppContext,
mut cx_b: TestAppContext,
) {
cx_a.foreground().forbid_parking();
let lang_registry = Arc::new(LanguageRegistry::new());
// Connect to a server as 2 clients.
@ -1285,8 +1284,6 @@ mod tests {
let (_, client_a) = server.create_client(&mut cx_a, "user_a").await;
let (_, client_b) = server.create_client(&mut cx_b, "user_b").await;
cx_a.foreground().forbid_parking();
// Share a local worktree as client A
let fs = Arc::new(FakeFs::new());
fs.save(Path::new("/a.txt"), &"a-contents".into())
@ -1339,6 +1336,7 @@ mod tests {
#[gpui::test]
async fn test_peer_disconnection(mut cx_a: TestAppContext, cx_b: TestAppContext) {
cx_a.foreground().forbid_parking();
let lang_registry = Arc::new(LanguageRegistry::new());
// Connect to a server as 2 clients.
@ -1346,8 +1344,6 @@ mod tests {
let (_, client_a) = server.create_client(&mut cx_a, "user_a").await;
let (_, client_b) = server.create_client(&mut cx_a, "user_b").await;
cx_a.foreground().forbid_parking();
// Share a local worktree as client A
let fs = Arc::new(FakeFs::new());
fs.insert_tree(