From dbc4a4d6327062918b3bc41dc3f60c84ae3c620b Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 20 Feb 2024 13:39:03 -0500 Subject: [PATCH] chore: fix flaky lsp_vendor_dir (#22483) I think it was occassionally reading the diagnostics from the previous cache command rather than the config update. Closes #22481 --- tests/integration/lsp_tests.rs | 4 ++++ tests/util/server/src/lsp.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 97e9215dfd..34ea7362c8 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -10666,6 +10666,10 @@ fn lsp_vendor_dir() { assert!(!temp_dir.path().join("vendor").exists()); + // read the diagnostic update after caching + let diagnostics = client.read_diagnostics(); + assert_eq!(diagnostics.all().len(), 0); + temp_dir.write( temp_dir.path().join("deno.json"), "{ \"vendor\": true, \"lock\": false }\n", diff --git a/tests/util/server/src/lsp.rs b/tests/util/server/src/lsp.rs index 6b8256fc1c..cc68083909 100644 --- a/tests/util/server/src/lsp.rs +++ b/tests/util/server/src/lsp.rs @@ -799,7 +799,7 @@ impl LspClient { result.as_u64().unwrap() as usize } - /// Reads the latest diagnostics. It's assumed that + /// Reads the latest diagnostics. pub fn read_diagnostics(&mut self) -> CollectedDiagnostics { // wait for three (deno, lint, and typescript diagnostics) batch // notification messages for that index