fix io_uring timeout_remove test on kernel 5.4

There is no grantee that `copy_cqes` will return exactly wait_nr number of cqes.
If there are ready cqes it can return > 0 but < wait_nr number of cqes.
This commit is contained in:
Igor Anić
2023-11-08 18:25:29 +01:00
parent bf0387b6bb
commit 7a1dbbd4f9

View File

@@ -2329,7 +2329,8 @@ test "timeout_remove" {
// * kernel 5.18 gives user data 0x99999999 first, 0x88888888 second
var cqes: [2]os.linux.io_uring_cqe = undefined;
try testing.expectEqual(@as(u32, 2), try ring.copy_cqes(cqes[0..], 2));
cqes[0] = try ring.copy_cqe();
cqes[1] = try ring.copy_cqe();
for (cqes) |cqe| {
// IORING_OP_TIMEOUT_REMOVE is not supported by this kernel version: