From bd51feac474c3d08868a70dd7f262d37780a5370 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Sun, 17 Mar 2024 14:57:31 +0330 Subject: [PATCH] readme: fix running loom tests guide (#6408) --- CONTRIBUTING.md | 4 +++- tokio/src/runtime/tests/loom_multi_thread_alt.rs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 623efd133..240b08be6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -184,9 +184,11 @@ it, `rustfmt` will update your files locally instead. You can run loom tests with ``` cd tokio # tokio crate in workspace -LOOM_MAX_PREEMPTIONS=1 RUSTFLAGS="--cfg loom" \ +LOOM_MAX_PREEMPTIONS=1 LOOM_MAX_BRANCHES=10000 RUSTFLAGS="--cfg loom -C debug_assertions" \ cargo test --lib --release --features full -- --test-threads=1 --nocapture ``` +Additionally, you can also add `--cfg tokio_unstable` to the `RUSTFLAGS` environment variable to +run loom tests that test unstable features. You can run miri tests with ``` diff --git a/tokio/src/runtime/tests/loom_multi_thread_alt.rs b/tokio/src/runtime/tests/loom_multi_thread_alt.rs index 1b9c3b477..c8d140e09 100644 --- a/tokio/src/runtime/tests/loom_multi_thread_alt.rs +++ b/tokio/src/runtime/tests/loom_multi_thread_alt.rs @@ -1,3 +1,5 @@ +#![cfg(tokio_unstable)] + mod queue; mod shutdown; mod yield_now;