Skip to content

Commit 2440d11

Browse files
authored
ci: enable tests using fcntl in miri (#7382)
1 parent ab8d7b8 commit 2440d11

File tree

3 files changed

+5
-24
lines changed

3 files changed

+5
-24
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ env:
1818
rust_stable: stable
1919
rust_nightly: nightly-2025-01-25
2020
# Pin a specific miri version
21-
rust_miri_nightly: nightly-2025-01-25
21+
rust_miri_nightly: nightly-2025-06-02
2222
rust_clippy: '1.77'
2323
# When updating this, also update:
2424
# - README.md

tokio/tests/io_async_fd.rs

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ fn drain(mut fd: &FileDescriptor, mut amt: usize) {
148148
}
149149

150150
#[tokio::test]
151-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
152151
async fn initially_writable() {
153152
let (a, b) = socketpair();
154153

@@ -167,7 +166,6 @@ async fn initially_writable() {
167166
}
168167

169168
#[tokio::test]
170-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
171169
async fn reset_readable() {
172170
let (a, mut b) = socketpair();
173171

@@ -212,7 +210,6 @@ async fn reset_readable() {
212210
}
213211

214212
#[tokio::test]
215-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
216213
async fn reset_writable() {
217214
let (a, b) = socketpair();
218215

@@ -250,7 +247,6 @@ impl<T: AsRawFd> AsRawFd for ArcFd<T> {
250247
}
251248

252249
#[tokio::test]
253-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
254250
async fn drop_closes() {
255251
let (a, mut b) = socketpair();
256252

@@ -291,7 +287,6 @@ async fn drop_closes() {
291287
}
292288

293289
#[tokio::test]
294-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
295290
async fn reregister() {
296291
let (a, _b) = socketpair();
297292

@@ -301,7 +296,6 @@ async fn reregister() {
301296
}
302297

303298
#[tokio::test]
304-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
305299
async fn guard_try_io() {
306300
let (a, mut b) = socketpair();
307301

@@ -337,7 +331,6 @@ async fn guard_try_io() {
337331
}
338332

339333
#[tokio::test]
340-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
341334
async fn try_io_readable() {
342335
let (a, mut b) = socketpair();
343336
let mut afd_a = AsyncFd::new(a).unwrap();
@@ -397,7 +390,6 @@ async fn try_io_readable() {
397390
}
398391

399392
#[tokio::test]
400-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
401393
async fn try_io_writable() {
402394
let (a, _b) = socketpair();
403395
let afd_a = AsyncFd::new(a).unwrap();
@@ -439,7 +431,6 @@ async fn try_io_writable() {
439431
}
440432

441433
#[tokio::test]
442-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
443434
async fn multiple_waiters() {
444435
let (a, mut b) = socketpair();
445436
let afd_a = Arc::new(AsyncFd::new(a).unwrap());
@@ -488,7 +479,8 @@ async fn multiple_waiters() {
488479
}
489480

490481
#[tokio::test]
491-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
482+
// Block on https://github.com/rust-lang/miri/issues/4374
483+
#[cfg_attr(miri, ignore)]
492484
async fn poll_fns() {
493485
let (a, b) = socketpair();
494486
let afd_a = Arc::new(AsyncFd::new(a).unwrap());
@@ -582,7 +574,6 @@ fn rt() -> tokio::runtime::Runtime {
582574
}
583575

584576
#[test]
585-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
586577
fn driver_shutdown_wakes_currently_pending() {
587578
let rt = rt();
588579

@@ -604,7 +595,6 @@ fn driver_shutdown_wakes_currently_pending() {
604595
}
605596

606597
#[test]
607-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
608598
fn driver_shutdown_wakes_future_pending() {
609599
let rt = rt();
610600

@@ -620,7 +610,6 @@ fn driver_shutdown_wakes_future_pending() {
620610
}
621611

622612
#[test]
623-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
624613
fn driver_shutdown_wakes_pending_race() {
625614
// TODO: make this a loom test
626615
for _ in 0..100 {
@@ -651,7 +640,6 @@ async fn poll_writable<T: AsRawFd>(fd: &AsyncFd<T>) -> std::io::Result<AsyncFdRe
651640
}
652641

653642
#[test]
654-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
655643
fn driver_shutdown_wakes_currently_pending_polls() {
656644
let rt = rt();
657645

@@ -674,7 +662,6 @@ fn driver_shutdown_wakes_currently_pending_polls() {
674662
}
675663

676664
#[test]
677-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
678665
fn driver_shutdown_wakes_poll() {
679666
let rt = rt();
680667

@@ -691,7 +678,6 @@ fn driver_shutdown_wakes_poll() {
691678
}
692679

693680
#[test]
694-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
695681
fn driver_shutdown_then_clear_readiness() {
696682
let rt = rt();
697683

@@ -709,7 +695,6 @@ fn driver_shutdown_then_clear_readiness() {
709695
}
710696

711697
#[test]
712-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
713698
fn driver_shutdown_wakes_poll_race() {
714699
// TODO: make this a loom test
715700
for _ in 0..100 {
@@ -773,7 +758,6 @@ fn send_oob_data<S: AsRawFd>(stream: &S, data: &[u8]) -> io::Result<usize> {
773758
}
774759

775760
#[tokio::test]
776-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
777761
async fn clear_ready_matching_clears_ready() {
778762
use tokio::io::{Interest, Ready};
779763

@@ -797,7 +781,6 @@ async fn clear_ready_matching_clears_ready() {
797781
}
798782

799783
#[tokio::test]
800-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
801784
async fn clear_ready_matching_clears_ready_mut() {
802785
use tokio::io::{Interest, Ready};
803786

@@ -878,7 +861,7 @@ fn configure_timestamping_socket(udp_socket: &std::net::UdpSocket) -> std::io::R
878861
}
879862

880863
#[tokio::test]
881-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
864+
#[cfg_attr(miri, ignore)] // No socket in miri.
882865
#[cfg(target_os = "linux")]
883866
async fn await_error_readiness_invalid_address() {
884867
use std::net::{Ipv4Addr, SocketAddr};

tokio/tests/net_unix_pipe.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ async fn anon_pipe_simple_send() -> io::Result<()> {
469469
}
470470

471471
#[tokio::test]
472-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
472+
#[cfg_attr(miri, ignore)] // No `pidfd_spawnp` in miri.
473473
async fn anon_pipe_spawn_echo() -> std::io::Result<()> {
474474
use tokio::process::Command;
475475

@@ -520,7 +520,6 @@ async fn anon_pipe_from_owned_fd() -> std::io::Result<()> {
520520
}
521521

522522
#[tokio::test]
523-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
524523
async fn anon_pipe_into_nonblocking_fd() -> std::io::Result<()> {
525524
let (tx, rx) = pipe::pipe()?;
526525

@@ -534,7 +533,6 @@ async fn anon_pipe_into_nonblocking_fd() -> std::io::Result<()> {
534533
}
535534

536535
#[tokio::test]
537-
#[cfg_attr(miri, ignore)] // No F_GETFL for fcntl in miri.
538536
async fn anon_pipe_into_blocking_fd() -> std::io::Result<()> {
539537
let (tx, rx) = pipe::pipe()?;
540538

0 commit comments

Comments
 (0)