authorgravatar for joran@ronomon.comJoran Dirk Greef <joran@ronomon.com> 2020-12-10 11:34:20+02:00
committergravatar for joran@ronomon.comJoran Dirk Greef <joran@ronomon.com> 2020-12-10 11:34:20+02:00
logb5a9fd9f98b65aea174700caa01e026e9225dfd7
tree04f1184670db49544434417ddc46b7e33e4e47eb
parentdd3eac2eb195037d198fb594775075cadf70808f

Skip timeout_remove test where not supported by the kernel


1 files changed, 9 insertions(+), 4 deletions(-)

lib/std/os/linux/io_uring.zig+9-4
......@@ -1376,12 +1376,17 @@ test "timeout_remove" {
13761376 testing.expectEqual(@as(u32, 2), try ring.submit());
13771377
13781378 const cqe_timeout = try ring.copy_cqe();
1379 if (cqe_timeout.user_data == 0x99999999 and cqe_timeout.res == -linux.EINVAL) {
1379 // IORING_OP_TIMEOUT_REMOVE is not supported by this kernel version:
1380 // Timeout remove operations set the fd to -1, which results in EBADF before EINVAL.
1381 // We use IORING_FEAT_RW_CUR_POS as a safety check here to make sure we are at least pre-5.6.
1382 // We don't want to skip this test for newer kernels.
1383 if (
1384 cqe_timeout.user_data == 0x99999999 and
1385 cqe_timeout.res == -linux.EBADF and
1386 (ring.features & linux.IORING_FEAT_RW_CUR_POS) == 0
1387 ) {
13801388 return error.SkipZigTest;
13811389 }
1382 if (cqe_timeout.user_data == 0x99999999) {
1383 std.debug.print("unexpected cqe={}\n", .{ cqe_timeout });
1384 }
13851390 testing.expectEqual(linux.io_uring_cqe{
13861391 .user_data = 0x88888888,
13871392 .res = -linux.ECANCELED,