From: Aleksey Kladov Date: Wed, 24 Jun 2020 10:27:13 +0000 (+0200) Subject: Disable file watching when running slow tests X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=a0b76161ab8507fd8abe0c1895aa5dd784978ae2;p=rust.git 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 --- diff --git a/crates/rust-analyzer/tests/heavy_tests/support.rs b/crates/rust-analyzer/tests/heavy_tests/support.rs index 001a2a10451..8d88f992dd2 100644 --- a/crates/rust-analyzer/tests/heavy_tests/support.rs +++ b/crates/rust-analyzer/tests/heavy_tests/support.rs @@ -19,7 +19,7 @@ use ra_project_model::ProjectManifest; use rust_analyzer::{ - config::{ClientCapsConfig, Config, LinkedProject}, + config::{ClientCapsConfig, Config, FilesConfig, FilesWatcher, LinkedProject}, main_loop, }; @@ -90,9 +90,9 @@ pub fn server(self) -> Server { }, 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 @@ fn send_request_(&self, r: Request) -> Value { 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);