Commit 7a1dbbd4f9

Igor Anić <igor.anic@gmail.com>
2023-11-08 18:25:29
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 parent bf0387b
Changed files (1)
lib
std
os
lib/std/os/linux/io_uring.zig
@@ -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: