1
1
#![ warn( rust_2018_idioms) ]
2
- #![ cfg( all( unix, feature = "full" , not ( miri ) ) ) ]
2
+ #![ cfg( all( unix, feature = "full" ) ) ]
3
3
4
4
use std:: os:: unix:: io:: { AsRawFd , RawFd } ;
5
5
use std:: sync:: {
@@ -148,6 +148,7 @@ fn drain(mut fd: &FileDescriptor, mut amt: usize) {
148
148
}
149
149
150
150
#[ tokio:: test]
151
+ #[ cfg_attr( miri, ignore) ] // No F_GETFL for fcntl in miri.
151
152
async fn initially_writable ( ) {
152
153
let ( a, b) = socketpair ( ) ;
153
154
@@ -166,6 +167,7 @@ async fn initially_writable() {
166
167
}
167
168
168
169
#[ tokio:: test]
170
+ #[ cfg_attr( miri, ignore) ] // No F_GETFL for fcntl in miri.
169
171
async fn reset_readable ( ) {
170
172
let ( a, mut b) = socketpair ( ) ;
171
173
@@ -210,6 +212,7 @@ async fn reset_readable() {
210
212
}
211
213
212
214
#[ tokio:: test]
215
+ #[ cfg_attr( miri, ignore) ] // No F_GETFL for fcntl in miri.
213
216
async fn reset_writable ( ) {
214
217
let ( a, b) = socketpair ( ) ;
215
218
@@ -247,6 +250,7 @@ impl<T: AsRawFd> AsRawFd for ArcFd<T> {
247
250
}
248
251
249
252
#[ tokio:: test]
253
+ #[ cfg_attr( miri, ignore) ] // No F_GETFL for fcntl in miri.
250
254
async fn drop_closes ( ) {
251
255
let ( a, mut b) = socketpair ( ) ;
252
256
@@ -287,6 +291,7 @@ async fn drop_closes() {
287
291
}
288
292
289
293
#[ tokio:: test]
294
+ #[ cfg_attr( miri, ignore) ] // No F_GETFL for fcntl in miri.
290
295
async fn reregister ( ) {
291
296
let ( a, _b) = socketpair ( ) ;
292
297
@@ -296,6 +301,7 @@ async fn reregister() {
296
301
}
297
302
298
303
#[ tokio:: test]
304
+ #[ cfg_attr( miri, ignore) ] // No F_GETFL for fcntl in miri.
299
305
async fn try_io ( ) {
300
306
let ( a, mut b) = socketpair ( ) ;
301
307
@@ -331,6 +337,7 @@ async fn try_io() {
331
337
}
332
338
333
339
#[ tokio:: test]
340
+ #[ cfg_attr( miri, ignore) ] // No F_GETFL for fcntl in miri.
334
341
async fn multiple_waiters ( ) {
335
342
let ( a, mut b) = socketpair ( ) ;
336
343
let afd_a = Arc :: new ( AsyncFd :: new ( a) . unwrap ( ) ) ;
@@ -379,6 +386,7 @@ async fn multiple_waiters() {
379
386
}
380
387
381
388
#[ tokio:: test]
389
+ #[ cfg_attr( miri, ignore) ] // No F_GETFL for fcntl in miri.
382
390
async fn poll_fns ( ) {
383
391
let ( a, b) = socketpair ( ) ;
384
392
let afd_a = Arc :: new ( AsyncFd :: new ( a) . unwrap ( ) ) ;
@@ -472,6 +480,7 @@ fn rt() -> tokio::runtime::Runtime {
472
480
}
473
481
474
482
#[ test]
483
+ #[ cfg_attr( miri, ignore) ] // No F_GETFL for fcntl in miri.
475
484
fn driver_shutdown_wakes_currently_pending ( ) {
476
485
let rt = rt ( ) ;
477
486
@@ -493,6 +502,7 @@ fn driver_shutdown_wakes_currently_pending() {
493
502
}
494
503
495
504
#[ test]
505
+ #[ cfg_attr( miri, ignore) ] // No F_GETFL for fcntl in miri.
496
506
fn driver_shutdown_wakes_future_pending ( ) {
497
507
let rt = rt ( ) ;
498
508
@@ -508,6 +518,7 @@ fn driver_shutdown_wakes_future_pending() {
508
518
}
509
519
510
520
#[ test]
521
+ #[ cfg_attr( miri, ignore) ] // No F_GETFL for fcntl in miri.
511
522
fn driver_shutdown_wakes_pending_race ( ) {
512
523
// TODO: make this a loom test
513
524
for _ in 0 ..100 {
@@ -538,6 +549,7 @@ async fn poll_writable<T: AsRawFd>(fd: &AsyncFd<T>) -> std::io::Result<AsyncFdRe
538
549
}
539
550
540
551
#[ test]
552
+ #[ cfg_attr( miri, ignore) ] // No F_GETFL for fcntl in miri.
541
553
fn driver_shutdown_wakes_currently_pending_polls ( ) {
542
554
let rt = rt ( ) ;
543
555
@@ -560,6 +572,7 @@ fn driver_shutdown_wakes_currently_pending_polls() {
560
572
}
561
573
562
574
#[ test]
575
+ #[ cfg_attr( miri, ignore) ] // No F_GETFL for fcntl in miri.
563
576
fn driver_shutdown_wakes_poll ( ) {
564
577
let rt = rt ( ) ;
565
578
@@ -576,6 +589,7 @@ fn driver_shutdown_wakes_poll() {
576
589
}
577
590
578
591
#[ test]
592
+ #[ cfg_attr( miri, ignore) ] // No F_GETFL for fcntl in miri.
579
593
fn driver_shutdown_then_clear_readiness ( ) {
580
594
let rt = rt ( ) ;
581
595
@@ -593,6 +607,7 @@ fn driver_shutdown_then_clear_readiness() {
593
607
}
594
608
595
609
#[ test]
610
+ #[ cfg_attr( miri, ignore) ] // No F_GETFL for fcntl in miri.
596
611
fn driver_shutdown_wakes_poll_race ( ) {
597
612
// TODO: make this a loom test
598
613
for _ in 0 ..100 {
@@ -615,6 +630,7 @@ fn driver_shutdown_wakes_poll_race() {
615
630
}
616
631
617
632
#[ tokio:: test]
633
+ #[ cfg_attr( miri, ignore) ] // No socket in miri.
618
634
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
619
635
async fn priority_event_on_oob_data ( ) {
620
636
use std:: net:: SocketAddr ;
@@ -655,7 +671,7 @@ fn send_oob_data<S: AsRawFd>(stream: &S, data: &[u8]) -> io::Result<usize> {
655
671
}
656
672
657
673
#[ tokio:: test]
658
- #[ cfg_attr( miri, ignore) ]
674
+ #[ cfg_attr( miri, ignore) ] // No F_GETFL for fcntl in miri.
659
675
async fn clear_ready_matching_clears_ready ( ) {
660
676
use tokio:: io:: { Interest , Ready } ;
661
677
@@ -679,7 +695,7 @@ async fn clear_ready_matching_clears_ready() {
679
695
}
680
696
681
697
#[ tokio:: test]
682
- #[ cfg_attr( miri, ignore) ]
698
+ #[ cfg_attr( miri, ignore) ] // No F_GETFL for fcntl in miri.
683
699
async fn clear_ready_matching_clears_ready_mut ( ) {
684
700
use tokio:: io:: { Interest , Ready } ;
685
701
@@ -703,8 +719,8 @@ async fn clear_ready_matching_clears_ready_mut() {
703
719
}
704
720
705
721
#[ tokio:: test]
722
+ #[ cfg_attr( miri, ignore) ] // No socket in miri.
706
723
#[ cfg( target_os = "linux" ) ]
707
- #[ cfg_attr( miri, ignore) ]
708
724
async fn await_error_readiness_timestamping ( ) {
709
725
use std:: net:: { Ipv4Addr , SocketAddr } ;
710
726
@@ -760,8 +776,8 @@ fn configure_timestamping_socket(udp_socket: &std::net::UdpSocket) -> std::io::R
760
776
}
761
777
762
778
#[ tokio:: test]
779
+ #[ cfg_attr( miri, ignore) ] // No F_GETFL for fcntl in miri.
763
780
#[ cfg( target_os = "linux" ) ]
764
- #[ cfg_attr( miri, ignore) ]
765
781
async fn await_error_readiness_invalid_address ( ) {
766
782
use std:: net:: { Ipv4Addr , SocketAddr } ;
767
783
use tokio:: io:: { Interest , Ready } ;
0 commit comments