From a0b76161ab8507fd8abe0c1895aa5dd784978ae2 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 24 Jun 2020 12:27:13 +0200 Subject: Disable file watching when running slow tests This should rid us of the intermittent test failure https://github.com/rust-analyzer/rust-analyzer/pull/5017#issuecomment-648717983 --- crates/rust-analyzer/tests/heavy_tests/support.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'crates') diff --git a/crates/rust-analyzer/tests/heavy_tests/support.rs b/crates/rust-analyzer/tests/heavy_tests/support.rs index 001a2a104..8d88f992d 100644 --- a/crates/rust-analyzer/tests/heavy_tests/support.rs +++ b/crates/rust-analyzer/tests/heavy_tests/support.rs @@ -19,7 +19,7 @@ use test_utils::{find_mismatch, Fixture}; use ra_project_model::ProjectManifest; use rust_analyzer::{ - config::{ClientCapsConfig, Config, LinkedProject}, + config::{ClientCapsConfig, Config, FilesConfig, FilesWatcher, LinkedProject}, main_loop, }; @@ -90,9 +90,9 @@ impl<'a> Project<'a> { }, with_sysroot: self.with_sysroot, linked_projects, + files: FilesConfig { watcher: FilesWatcher::Client, exclude: Vec::new() }, ..Config::default() }; - if let Some(f) = &self.config { f(&mut config) } @@ -173,8 +173,14 @@ impl Server { self.client.sender.send(r.into()).unwrap(); while let Some(msg) = self.recv() { match msg { - Message::Request(req) if req.method == "window/workDoneProgress/create" => (), - Message::Request(req) => panic!("unexpected request: {:?}", req), + Message::Request(req) => { + if req.method != "window/workDoneProgress/create" + && !(req.method == "client/registerCapability" + && req.params.to_string().contains("workspace/didChangeWatchedFiles")) + { + panic!("unexpected request: {:?}", req) + } + } Message::Notification(_) => (), Message::Response(res) => { assert_eq!(res.id, id); -- cgit v1.2.3