Skip to content

Commit 1ce3b0c

Browse files
committed
Fix race in the tests
1 parent 623b035 commit 1ce3b0c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

crates/ra_prof/src/lib.rs

+8
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,14 @@ pub fn print_backtrace() {
339339
let bt = backtrace::Backtrace::new();
340340
eprintln!("{:?}", bt);
341341
}
342+
#[cfg(not(feature = "backtrace"))]
343+
pub fn print_backtrace() {
344+
eprintln!(
345+
r##"enable the backtrace feature:
346+
ra_prof = { path = "../ra_prof", features = [ "backtrace"] }
347+
"##
348+
);
349+
}
342350

343351
thread_local!(static IN_SCOPE: RefCell<bool> = RefCell::new(false));
344352

crates/rust-analyzer/tests/heavy_tests/support.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ pub fn project(fixture: &str) -> Server {
8383
pub struct Server {
8484
req_id: Cell<u64>,
8585
messages: RefCell<Vec<Message>>,
86-
dir: TempDir,
8786
_thread: jod_thread::JoinHandle<()>,
8887
client: Connection,
88+
/// XXX: remove the tempdir last
89+
dir: TempDir,
8990
}
9091

9192
impl Server {

0 commit comments

Comments
 (0)