io_uring: ignore SOCK_NONEMPTY for reproducible tests

Fixes #12670
This commit is contained in:
Jacob Young 2022-10-01 20:40:18 -04:00 committed by Veikka Tuominen
parent 0eb3b8fa44
commit f5f28e0d2c
2 changed files with 6 additions and 2 deletions

View File

@ -3761,6 +3761,8 @@ pub const IORING_CQE_F_BUFFER = 1 << 0;
pub const IORING_CQE_F_MORE = 1 << 1;
/// If set, more data to read after socket recv
pub const IORING_CQE_F_SOCK_NONEMPTY = 1 << 2;
/// Set for notification CQEs. Can be used to distinct them from sends.
pub const IORING_CQE_F_NOTIF = 1 << 3;
/// Magic offsets for the application to mmap the data it needs
pub const IORING_OFF_SQ_RING = 0;

View File

@ -2007,7 +2007,8 @@ test "accept/connect/send/recv" {
try testing.expectEqual(linux.io_uring_cqe{
.user_data = 0xffffffff,
.res = buffer_recv.len,
.flags = 0,
// ignore IORING_CQE_F_SOCK_NONEMPTY since it is only set on some systems
.flags = cqe_recv.flags & linux.IORING_CQE_F_SOCK_NONEMPTY,
}, cqe_recv);
try testing.expectEqualSlices(u8, buffer_send[0..buffer_recv.len], buffer_recv[0..]);
@ -2089,7 +2090,8 @@ test "sendmsg/recvmsg" {
try testing.expectEqual(linux.io_uring_cqe{
.user_data = 0x22222222,
.res = buffer_recv.len,
.flags = 0,
// ignore IORING_CQE_F_SOCK_NONEMPTY since it is set non-deterministically
.flags = cqe_recvmsg.flags & linux.IORING_CQE_F_SOCK_NONEMPTY,
}, cqe_recvmsg);
try testing.expectEqualSlices(u8, buffer_send[0..buffer_recv.len], buffer_recv[0..]);