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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user