From 67c48409c8423c2bc309a1df48bc0800d330c5f7 Mon Sep 17 00:00:00 2001 From: audichuang <72485427+audichuang@users.noreply.github.com> Date: Sun, 6 Dec 2026 02:28:25 +0800 Subject: [PATCH] test(lsp): wait for the own server's documents in the selector test (#8255) a_server_is_sent_the_documents_it_registers_a_selector_for waited for one server's didOpen and then asserted the other server's at once; the two are sent separately, so it failed now and then. It now waits for both. Co-authored-by: audichuang <72485427+audichuang@users.noreply.github.com> --- crates/ide-lsp/tests/integration/mock_server.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ide-lsp/tests/integration/mock_server.rs b/crates/ide-lsp/tests/integration/mock_server.rs index bba6268908..2957c8c8e5 100644 --- a/crates/ide-lsp/tests/integration/mock_server.rs +++ b/crates/ide-lsp/tests/integration/mock_server.rs @@ -9678,7 +9678,8 @@ async fn a_server_is_sent_the_documents_it_registers_a_selector_for() { let after = open_data("after.dt"); eventually(|| fw.docs.lock().contains_key(&uri_of(&after))).await; // Its own server keeps the documents, and one the selector doesn't name stays with it alone. - assert!(own.docs.lock().contains_key(&uri_of(&after)) && own.docs.lock().contains_key(&uri_of(&unrelated))); + eventually(|| own.docs.lock().contains_key(&uri_of(&after)) && own.docs.lock().contains_key(&uri_of(&unrelated))) + .await; assert!(!fw.docs.lock().contains_key(&uri_of(&unrelated))); // The server list names the language among the ones it serves. let served = h.mgr.servers().into_iter().find(|s| s.name == "fw").unwrap().languages;