From 1f994405a960858fb33b3f2e527f8750ba9cefaa Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Wed, 28 Dec 2022 21:48:11 +0900 Subject: [PATCH] ignore more unsupported tests --- tokio/tests/fs_file.rs | 2 +- tokio/tests/io_fill_buf.rs | 2 +- tokio/tests/macros_rename_test.rs | 1 + tokio/tests/rt_basic.rs | 4 +--- tokio/tests/rt_common.rs | 3 +-- tokio/tests/rt_handle_block_on.rs | 1 + tokio/tests/rt_threaded.rs | 1 + tokio/tests/sync_mpsc.rs | 4 ++++ tokio/tests/sync_rwlock.rs | 1 + tokio/tests/task_local.rs | 2 ++ 10 files changed, 14 insertions(+), 7 deletions(-) diff --git a/tokio/tests/fs_file.rs b/tokio/tests/fs_file.rs index fcd6beaa7db..e86e42a3055 100644 --- a/tokio/tests/fs_file.rs +++ b/tokio/tests/fs_file.rs @@ -1,6 +1,6 @@ #![warn(rust_2018_idioms)] #![cfg(all(feature = "full", not(tokio_wasi)))] // Wasi does not support file operations -#![cfg(not(miri))] // Miri doesn't support opening file with non-default mode (inside NamedTempFile::new) +#![cfg(not(miri))] // Miri doesn't support creating file with non-default mode (inside NamedTempFile::new): https://github.com/rust-lang/miri/pull/2720 use std::io::prelude::*; use tempfile::NamedTempFile; diff --git a/tokio/tests/io_fill_buf.rs b/tokio/tests/io_fill_buf.rs index a8c5beef045..16e351165aa 100644 --- a/tokio/tests/io_fill_buf.rs +++ b/tokio/tests/io_fill_buf.rs @@ -1,6 +1,6 @@ #![warn(rust_2018_idioms)] #![cfg(all(feature = "full", not(tokio_wasi)))] // Wasi does not support file operations -#![cfg(not(miri))] // Miri doesn't support opening file with non-default mode (inside NamedTempFile::new) +#![cfg(not(miri))] // Miri doesn't support creating file with non-default mode (inside NamedTempFile::new): https://github.com/rust-lang/miri/pull/2720 use tempfile::NamedTempFile; use tokio::fs::File; diff --git a/tokio/tests/macros_rename_test.rs b/tokio/tests/macros_rename_test.rs index 90a86f9722b..2bf7944860f 100644 --- a/tokio/tests/macros_rename_test.rs +++ b/tokio/tests/macros_rename_test.rs @@ -1,4 +1,5 @@ #![cfg(all(feature = "full", not(tokio_wasi)))] // Wasi doesn't support threading +#![cfg(not(miri))] // Miri doesn't support write to event (inside mio::waker::Waker::wake) #[allow(unused_imports)] use std as tokio; diff --git a/tokio/tests/rt_basic.rs b/tokio/tests/rt_basic.rs index b82739f39f0..d38c4191b56 100644 --- a/tokio/tests/rt_basic.rs +++ b/tokio/tests/rt_basic.rs @@ -1,5 +1,6 @@ #![warn(rust_2018_idioms)] #![cfg(feature = "full")] +#![cfg(not(miri))] // Miri doesn't support write to event (inside mio::waker::Waker::wake) use tokio::runtime::Runtime; use tokio::sync::oneshot; @@ -45,7 +46,6 @@ fn spawned_task_does_not_progress_without_block_on() { } #[test] -#[cfg_attr(miri, ignore)] // Miri doesn't support write to event (inside mio::waker::Waker::wake) fn no_extra_poll() { use pin_project_lite::pin_project; use std::pin::Pin; @@ -114,7 +114,6 @@ fn no_extra_poll() { } #[test] -#[cfg_attr(miri, ignore)] // Miri doesn't support write to event (inside mio::waker::Waker::wake) fn acquire_mutex_in_drop() { use futures::future::pending; use tokio::task; @@ -151,7 +150,6 @@ fn acquire_mutex_in_drop() { } #[test] -#[cfg_attr(miri, ignore)] // Miri doesn't support write to event (inside mio::waker::Waker::wake) fn drop_tasks_in_context() { static SUCCESS: AtomicBool = AtomicBool::new(false); diff --git a/tokio/tests/rt_common.rs b/tokio/tests/rt_common.rs index c5fee65f579..9850f28a0b9 100644 --- a/tokio/tests/rt_common.rs +++ b/tokio/tests/rt_common.rs @@ -1,6 +1,7 @@ #![allow(clippy::needless_range_loop)] #![warn(rust_2018_idioms)] #![cfg(feature = "full")] +#![cfg(not(miri))] // Miri doesn't support epoll_wait // Tests to run on both current-thread & multi-thread runtime variants. @@ -106,7 +107,6 @@ rt_test! { #[cfg(not(target_os="wasi"))] #[test] - #[cfg_attr(miri, ignore)] // Miri doesn't support epoll_wait fn block_on_async() { let rt = rt(); @@ -607,7 +607,6 @@ rt_test! { #[cfg(not(target_os="wasi"))] // Wasi does not support threads #[test] - #[cfg_attr(miri, ignore)] // Miri doesn't support epoll_wait fn always_active_parker() { // This test it to show that we will always have // an active parker even if we call block_on concurrently diff --git a/tokio/tests/rt_handle_block_on.rs b/tokio/tests/rt_handle_block_on.rs index 5ec783e5588..2fc6685b8ca 100644 --- a/tokio/tests/rt_handle_block_on.rs +++ b/tokio/tests/rt_handle_block_on.rs @@ -1,5 +1,6 @@ #![warn(rust_2018_idioms)] #![cfg(feature = "full")] +#![cfg(not(miri))] // Miri doesn't support epoll_wait // All io tests that deal with shutdown is currently ignored because there are known bugs in with // shutting down the io driver while concurrently registering new resources. See diff --git a/tokio/tests/rt_threaded.rs b/tokio/tests/rt_threaded.rs index c5984182cec..e8009174e0b 100644 --- a/tokio/tests/rt_threaded.rs +++ b/tokio/tests/rt_threaded.rs @@ -1,5 +1,6 @@ #![warn(rust_2018_idioms)] #![cfg(all(feature = "full", not(tokio_wasi)))] +#![cfg(not(miri))] // Miri doesn't support epoll_wait use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::net::{TcpListener, TcpStream}; diff --git a/tokio/tests/sync_mpsc.rs b/tokio/tests/sync_mpsc.rs index c262f02b143..a6c845cbf36 100644 --- a/tokio/tests/sync_mpsc.rs +++ b/tokio/tests/sync_mpsc.rs @@ -275,6 +275,7 @@ async fn send_recv_buffer_limited() { } #[maybe_tokio_test] +#[cfg_attr(miri, ignore)] // Miri doesn't support write to event (inside mio::waker::Waker::wake) async fn recv_close_gets_none_idle() { let (tx, mut rx) = mpsc::channel::(10); @@ -287,6 +288,7 @@ async fn recv_close_gets_none_idle() { #[tokio::test] #[cfg(feature = "full")] +#[cfg_attr(miri, ignore)] // Miri doesn't support write to event (inside mio::waker::Waker::wake) async fn recv_close_gets_none_reserved() { let (tx1, mut rx) = mpsc::channel::(1); let tx2 = tx1.clone(); @@ -525,6 +527,7 @@ async fn ready_close_cancel_bounded() { #[tokio::test] #[cfg(feature = "full")] +#[cfg_attr(miri, ignore)] // Miri doesn't support write to event (inside mio::waker::Waker::wake) async fn permit_available_not_acquired_close() { let (tx1, mut rx) = mpsc::channel::<()>(1); let tx2 = tx1.clone(); @@ -625,6 +628,7 @@ fn try_recv_close_while_empty_unbounded() { #[tokio::test(start_paused = true)] #[cfg(feature = "full")] +#[cfg_attr(miri, ignore)] // Miri doesn't support write to event (inside mio::waker::Waker::wake) async fn recv_timeout() { use tokio::sync::mpsc::error::SendTimeoutError::{Closed, Timeout}; use tokio::time::Duration; diff --git a/tokio/tests/sync_rwlock.rs b/tokio/tests/sync_rwlock.rs index 948ec131ed1..52db532549e 100644 --- a/tokio/tests/sync_rwlock.rs +++ b/tokio/tests/sync_rwlock.rs @@ -174,6 +174,7 @@ async fn write_order() { // A single RwLock is contested by tasks in multiple threads #[cfg(all(feature = "full", not(tokio_wasi)))] // Wasi doesn't support threads #[tokio::test(flavor = "multi_thread", worker_threads = 8)] +#[cfg_attr(miri, ignore)] // Miri doesn't support epoll_wait async fn multithreaded() { use futures::stream::{self, StreamExt}; use std::sync::Arc; diff --git a/tokio/tests/task_local.rs b/tokio/tests/task_local.rs index 949a40c2a4d..874d1336311 100644 --- a/tokio/tests/task_local.rs +++ b/tokio/tests/task_local.rs @@ -1,5 +1,7 @@ #![cfg(all(feature = "full", not(tokio_wasi)))] // Wasi doesn't support threads #![allow(clippy::declare_interior_mutable_const)] +#![cfg(not(miri))] // Miri doesn't support write to event (inside mio::waker::Waker::wake) + use std::future::Future; use std::pin::Pin; use std::task::{Context, Poll};