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