]> git.feebdaed.xyz Git - 0xmirror/tokio.git/commitdiff
tokio: enable more tests in Miri (#7734)
authorRalf Jung <post@ralfj.de>
Sat, 29 Nov 2025 07:08:47 +0000 (08:08 +0100)
committerGitHub <noreply@github.com>
Sat, 29 Nov 2025 07:08:47 +0000 (15:08 +0800)
12 files changed:
.github/workflows/ci.yml
CONTRIBUTING.md
tokio/src/io/stdio_common.rs
tokio/src/loom/std/mod.rs
tokio/src/process/unix/orphan.rs
tokio/src/runtime/runtime.rs
tokio/src/runtime/tests/mod.rs
tokio/tests/io_async_fd.rs
tokio/tests/process_change_of_runtime.rs
tokio/tests/process_kill_after_wait.rs
tokio/tests/process_smoke.rs
tokio/tests/rt_basic.rs

index e6d81683f6bca56d57af75f298d0485675b1fa9b..6558330acfc8001837b06a308934abcb3ee3fda6 100644 (file)
@@ -18,7 +18,7 @@ env:
   rust_stable: stable
   rust_nightly: nightly-2025-10-12
   # Pin a specific miri version
-  rust_miri_nightly: nightly-2025-11-09
+  rust_miri_nightly: nightly-2025-11-13
   rust_clippy: '1.88'
   # When updating this, also update:
   # - README.md
@@ -372,7 +372,7 @@ jobs:
           cargo miri nextest run --features full --lib --no-fail-fast
         working-directory: tokio
         env:
-          MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance -Zmiri-retag-fields
+          MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance
 
   miri-test:
     name: miri-test
@@ -395,7 +395,7 @@ jobs:
           cargo miri nextest run --features full --test '*' --no-fail-fast
         working-directory: tokio
         env:
-          MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance -Zmiri-retag-fields
+          MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance
 
   miri-doc:
     name: miri-doc
@@ -414,7 +414,7 @@ jobs:
           cargo miri test --doc --features $TOKIO_STABLE_FEATURES --no-fail-fast
         working-directory: tokio
         env:
-          MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance -Zmiri-retag-fields
+          MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance
 
   asan:
     name: asan
index c1cbfc6a5a775016868581a00a1edb9f257c39b5..0d12b07449597d4caa950f65ccd95efe3d901659 100644 (file)
@@ -200,7 +200,7 @@ run loom tests that test unstable features.
 
 You can run miri tests with
 ```
-MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-strict-provenance -Zmiri-retag-fields" \
+MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-strict-provenance" \
     cargo +nightly miri test --features full --lib --tests
 ```
 
index 4adbfe236060f886dfc34d1b273993a807889075..a709bef31c4df8a4b8d352077fff64a6fce8583c 100644 (file)
@@ -177,7 +177,7 @@ mod tests {
     }
 
     #[test]
-    #[cfg_attr(miri, ignore)]
+    #[cfg_attr(miri, ignore)] // takes a really long time with miri
     fn test_splitter() {
         let data = str::repeat("█", DEFAULT_MAX_BUF_SIZE);
         let mut wr = super::SplitByUtf8BoundaryIfWindows::new(TextMockWriter);
@@ -191,7 +191,7 @@ mod tests {
     }
 
     #[test]
-    #[cfg_attr(miri, ignore)]
+    #[cfg_attr(miri, ignore)] // takes a really long time with miri
     fn test_pseudo_text() {
         // In this test we write a piece of binary data, whose beginning is
         // text though. We then validate that even in this corner case buffer
index d3556c953cd363216afefa6b88492bb4f5de4d98..68e9716161b18692c09c7bef88f10bb7dcf352dc 100644 (file)
@@ -51,6 +51,7 @@ pub(crate) mod sync {
     // internal use. Note however that some are not _currently_ named by
     // consuming code.
 
+    // Not using parking_lot in Miri due to <https://github.com/Amanieu/parking_lot/issues/477>.
     #[cfg(all(feature = "parking_lot", not(miri)))]
     #[allow(unused_imports)]
     pub(crate) use crate::loom::std::parking_lot::{
index a89555f58763d81eda4ca91300560d16f0f4fd36..6aa0539fec48994a5018a15156627a367145ccc6 100644 (file)
@@ -292,7 +292,7 @@ pub(crate) mod test {
         drop(signal_guard);
     }
 
-    #[cfg_attr(miri, ignore)] // Miri does not support epoll.
+    #[cfg_attr(miri, ignore)] // No `sigaction` on Miri
     #[test]
     fn does_not_register_signal_if_queue_empty() {
         let (io_driver, io_handle) = IoDriver::new(1024).unwrap();
index 609b27831e8dac2e6d11a9284d4f825e5b39b06a..af1711fad389c87212c3181fdbdbab9947d6425b 100644 (file)
@@ -431,7 +431,6 @@ impl Runtime {
     /// use std::time::Duration;
     ///
     /// fn main() {
-    /// #  if cfg!(miri) { return } // Miri reports error when main thread terminated without waiting all remaining threads.
     ///    let runtime = Runtime::new().unwrap();
     ///
     ///    runtime.block_on(async move {
index 5471ffc2e6b6cd01983c94ed06500715bdf2cc2b..b277cfa65501bb65195518313a3b13b5093c0798 100644 (file)
@@ -77,7 +77,7 @@ cfg_not_loom! {
     mod inject;
     mod queue;
 
-    #[cfg(not(miri))]
+    #[cfg(not(miri))] // takes a really long time with miri
     mod task_combinations;
 
     #[cfg(miri)]
index 51ea79d5155f5f996e9838bfdc51b7eba08fb468..c9a7302d3fcb02c91b55b733084922d8780ef47e 100644 (file)
@@ -479,8 +479,6 @@ async fn multiple_waiters() {
 }
 
 #[tokio::test]
-// Block on https://github.com/rust-lang/miri/issues/4374
-#[cfg_attr(miri, ignore)]
 async fn poll_fns() {
     let (a, b) = socketpair();
     let afd_a = Arc::new(AsyncFd::new(a).unwrap());
index 968463fdd8b0daa2926cc713617ca76cdcf289e6..e1de0bc21882fb27e07d99ded18b8125e2e79f8a 100644 (file)
@@ -3,7 +3,7 @@
 // This tests test the behavior of `process::Command::spawn` when it is used
 // outside runtime, and when `process::Child::wait ` is used in a different
 // runtime from which `process::Command::spawn` is used.
-#![cfg(all(unix, not(target_os = "freebsd"), not(miri)))]
+#![cfg(all(unix, not(target_os = "freebsd"), not(miri)))] // Miri cannot run system commands
 
 use std::process::Stdio;
 use tokio::{process::Command, runtime::Runtime};
index 7e1e9fc61f0adda6d4374569046bb6671ab1f1ec..639b104fd2c6713b6ac403d95d23a325db92f278 100644 (file)
@@ -1,5 +1,5 @@
 #![warn(rust_2018_idioms)]
-#![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi cannot run system commands
+#![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi/Miri cannot run system commands
 
 use tokio::process::Command;
 
index e7fec6d61bea5de2f28bc8dc42c51aef45968768..e4785e51ac88abfd5a9d7f95d7108215f81a5478 100644 (file)
@@ -1,5 +1,5 @@
 #![warn(rust_2018_idioms)]
-#![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi cannot run system commands
+#![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi/Miri cannot run system commands
 
 use tokio::process::Command;
 use tokio_test::assert_ok;
index cedea3811a38d8b8f007178618946893c29d5493..23845bda53d01ed56cc0a2a7b516f29a9158156a 100644 (file)
@@ -1,6 +1,5 @@
 #![warn(rust_2018_idioms)]
 #![cfg(feature = "full")]
-#![cfg(not(miri))] // Possible bug on Miri.
 
 use tokio::runtime::Runtime;
 use tokio::sync::oneshot;