authorgravatar for igor.anic@gmail.comIgor Anić <igor.anic@gmail.com> 2023-11-08 18:25:29+01:00
committergravatar for igor.anic@gmail.comIgor Anić <igor.anic@gmail.com> 2023-11-08 18:25:29+01:00
log7a1dbbd4f93f7e6221eab7f8c26b464685728bf6
treec3432570b05f586e24a553a75a903ec2404347f6
parentbf0387b6bb9c65c30f14e699a2f2cfbfea27184e

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.

1 files changed, 2 insertions(+), 1 deletions(-)

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