File tree 1 file changed +9
-3
lines changed
src/tools/miri/tests/pass-dep/libc
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -478,11 +478,17 @@ fn test_socketpair_read() {
478
478
assert_eq ! ( res, 3 ) ;
479
479
assert_eq ! ( buf, "abc" . as_bytes( ) ) ;
480
480
481
- // Notification will be provided.
482
- // But in real system, no notification will be provided here.
481
+ // Notification will be provided in Miri.
482
+ // But in real systems, no notification will be provided here, since Linux prefers to avoid
483
+ // wakeups that are likely to lead to only small amounts of data being read/written.
484
+ // We make the test work in both cases, thus documenting the difference in behavior.
483
485
let expected_event = u32:: try_from ( libc:: EPOLLOUT ) . unwrap ( ) ;
484
486
let expected_value = fds[ 1 ] as u64 ;
485
- check_epoll_wait :: < 8 > ( epfd, & [ ( expected_event, expected_value) ] ) ;
487
+ if cfg ! ( miri) {
488
+ check_epoll_wait :: < 8 > ( epfd, & [ ( expected_event, expected_value) ] ) ;
489
+ } else {
490
+ check_epoll_wait :: < 8 > ( epfd, & [ ] ) ;
491
+ }
486
492
487
493
// Read until the buffer is empty.
488
494
let mut buf: [ u8 ; 2 ] = [ 0 ; 2 ] ;
You can’t perform that action at this time.
0 commit comments