mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-01 17:42:47 +00:00
Fix race in the tests
This commit is contained in:
parent
f7df0b56a7
commit
12297ab675
@ -35,10 +35,10 @@ pub struct CheckOptions {
|
||||
/// The spawned thread is shut down when this struct is dropped.
|
||||
#[derive(Debug)]
|
||||
pub struct CheckWatcher {
|
||||
pub task_recv: Receiver<CheckTask>,
|
||||
// XXX: drop order is significant
|
||||
cmd_send: Option<Sender<CheckCommand>>,
|
||||
handle: Option<jod_thread::JoinHandle<()>>,
|
||||
pub task_recv: Receiver<CheckTask>,
|
||||
}
|
||||
|
||||
impl CheckWatcher {
|
||||
|
@ -339,6 +339,14 @@ pub fn print_backtrace() {
|
||||
let bt = backtrace::Backtrace::new();
|
||||
eprintln!("{:?}", bt);
|
||||
}
|
||||
#[cfg(not(feature = "backtrace"))]
|
||||
pub fn print_backtrace() {
|
||||
eprintln!(
|
||||
r#"enable the backtrace feature:
|
||||
ra_prof = {{ path = "../ra_prof", features = [ "backtrace"] }}
|
||||
"#
|
||||
);
|
||||
}
|
||||
|
||||
thread_local!(static IN_SCOPE: RefCell<bool> = RefCell::new(false));
|
||||
|
||||
|
@ -83,9 +83,10 @@ pub fn project(fixture: &str) -> Server {
|
||||
pub struct Server {
|
||||
req_id: Cell<u64>,
|
||||
messages: RefCell<Vec<Message>>,
|
||||
dir: TempDir,
|
||||
_thread: jod_thread::JoinHandle<()>,
|
||||
client: Connection,
|
||||
/// XXX: remove the tempdir last
|
||||
dir: TempDir,
|
||||
}
|
||||
|
||||
impl Server {
|
||||
|
Loading…
Reference in New Issue
Block a user