Skip to content

Commit 08b6ce7

Browse files
committed
Add annotation for tests with miri ignore
1 parent cbdceb9 commit 08b6ce7

37 files changed

+103
-23
lines changed

tokio-stream/tests/stream_chain.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ where
4949
}
5050

5151
#[tokio::test]
52+
#[cfg_attr(miri, ignore)] // Block on https://github.com/tokio-rs/tokio/issues/6860
5253
async fn pending_first() {
5354
let (tx1, rx1) = mpsc::unbounded_channel_stream();
5455
let (tx2, rx2) = mpsc::unbounded_channel_stream();

tokio/tests/buffered.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::net::TcpStream;
99
use std::thread;
1010

1111
#[tokio::test]
12-
#[cfg_attr(miri, ignore)]
12+
#[cfg_attr(miri, ignore)] // No `socket` on miri.
1313
async fn echo_server() {
1414
const N: usize = 1024;
1515

tokio/tests/coop_budget.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use tokio::net::UdpSocket;
2222
/// Since we are both sending and receiving, that should happen once per 64 packets, because budgets are of size 128
2323
/// and there are two budget events per packet, a send and a recv.
2424
#[tokio::test]
25-
#[cfg_attr(miri, ignore)]
25+
#[cfg_attr(miri, ignore)] // No `socket` on miri.
2626
async fn coop_budget_udp_send_recv() {
2727
const BUDGET: usize = 128;
2828
const N_ITERATIONS: usize = 1024;

tokio/tests/fs_copy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use tempfile::tempdir;
55
use tokio::fs;
66

77
#[tokio::test]
8-
#[cfg_attr(miri, ignore)]
8+
#[cfg_attr(miri, ignore)] // No `fchmod` in miri.
99
async fn copy() {
1010
let dir = tempdir().unwrap();
1111

@@ -22,7 +22,7 @@ async fn copy() {
2222
}
2323

2424
#[tokio::test]
25-
#[cfg_attr(miri, ignore)]
25+
#[cfg_attr(miri, ignore)] // No `fchmod` in miri.
2626
async fn copy_permissions() {
2727
let dir = tempdir().unwrap();
2828
let from_path = dir.path().join("foo.txt");

tokio/tests/fs_link.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::io::Write;
77
use tempfile::tempdir;
88

99
#[tokio::test]
10-
#[cfg_attr(miri, ignore)]
10+
#[cfg_attr(miri, ignore)] // No `linkat` in miri.
1111
async fn test_hard_link() {
1212
let dir = tempdir().unwrap();
1313
let src = dir.path().join("src.txt");

tokio/tests/fs_try_exists.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use tempfile::tempdir;
55
use tokio::fs;
66

77
#[tokio::test]
8-
#[cfg_attr(miri, ignore)]
8+
#[cfg_attr(miri, ignore)] // No `chmod` in miri.
99
async fn try_exists() {
1010
let dir = tempdir().unwrap();
1111

tokio/tests/io_async_fd.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,7 @@ fn driver_shutdown_wakes_poll_race() {
734734
#[tokio::test]
735735
#[cfg_attr(miri, ignore)] // No socket in miri.
736736
#[cfg(any(target_os = "linux", target_os = "android"))]
737+
#[cfg_attr(miri, ignore)] // No `socket` in miri.
737738
async fn priority_event_on_oob_data() {
738739
use std::net::SocketAddr;
739740

@@ -823,6 +824,10 @@ async fn clear_ready_matching_clears_ready_mut() {
823824
#[tokio::test]
824825
#[cfg_attr(miri, ignore)] // No socket in miri.
825826
#[cfg(target_os = "linux")]
827+
<<<<<<< HEAD
828+
=======
829+
#[cfg_attr(miri, ignore)] // No `socket` in miri.
830+
>>>>>>> 66e3947b (Add annotation for tests with miri ignore)
826831
async fn await_error_readiness_timestamping() {
827832
use std::net::{Ipv4Addr, SocketAddr};
828833

tokio/tests/io_copy_bidirectional.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(rust_2018_idioms)]
2-
#![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi does not support bind()
2+
#![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi does not support bind()
33

44
use std::time::Duration;
55
use tokio::io::{self, copy_bidirectional, AsyncReadExt, AsyncWriteExt};
@@ -59,6 +59,7 @@ where
5959
}
6060

6161
#[tokio::test]
62+
#[cfg_attr(miri, ignore)] // No `socket` in miri.
6263
async fn test_basic_transfer() {
6364
symmetric(|_handle, mut a, mut b| async move {
6465
a.write_all(b"test").await.unwrap();
@@ -70,6 +71,7 @@ async fn test_basic_transfer() {
7071
}
7172

7273
#[tokio::test]
74+
#[cfg_attr(miri, ignore)] // No `socket` in miri.
7375
async fn test_transfer_after_close() {
7476
symmetric(|handle, mut a, mut b| async move {
7577
AsyncWriteExt::shutdown(&mut a).await.unwrap();
@@ -89,6 +91,7 @@ async fn test_transfer_after_close() {
8991
}
9092

9193
#[tokio::test]
94+
#[cfg_attr(miri, ignore)] // No `socket` in miri.
9295
async fn blocking_one_side_does_not_block_other() {
9396
symmetric(|handle, mut a, mut b| async move {
9497
block_write(&mut a).await;

tokio/tests/io_driver.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![warn(rust_2018_idioms)]
22
// Wasi does not support panic recovery or threading
3-
#![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))]
3+
#![cfg(all(feature = "full", not(target_os = "wasi")))]
44

55
use tokio::net::TcpListener;
66
use tokio::runtime;
@@ -32,6 +32,7 @@ impl<T> Task<T> {
3232
}
3333

3434
#[test]
35+
#[cfg_attr(miri, ignore)] // No `socket` in miri.
3536
fn test_drop_on_notify() {
3637
// When the reactor receives a kernel notification, it notifies the
3738
// task that holds the associated socket. If this notification results in
@@ -90,6 +91,7 @@ fn test_drop_on_notify() {
9091
#[should_panic(
9192
expected = "A Tokio 1.x context was found, but IO is disabled. Call `enable_io` on the runtime builder to enable IO."
9293
)]
94+
#[cfg_attr(miri, ignore)] // No `socket` in miri.
9395
fn panics_when_io_disabled() {
9496
let rt = runtime::Builder::new_current_thread().build().unwrap();
9597

tokio/tests/io_driver_drop.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#![warn(rust_2018_idioms)]
2-
#![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi does not support bind
2+
#![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi does not support bind
33

44
use tokio::net::TcpListener;
55
use tokio::runtime;
66
use tokio_test::{assert_err, assert_pending, assert_ready, task};
77

88
#[test]
9+
#[cfg_attr(miri, ignore)] // No `socket` in miri.
910
fn tcp_doesnt_block() {
1011
let rt = rt();
1112

@@ -25,6 +26,7 @@ fn tcp_doesnt_block() {
2526
}
2627

2728
#[test]
29+
#[cfg_attr(miri, ignore)] // No `socket` in miri.
2830
fn drop_wakes() {
2931
let rt = rt();
3032

0 commit comments

Comments
 (0)