authorgravatar for michael.dusan@gmail.comMichael Dusan <michael.dusan@gmail.com> 2021-04-02 00:10:15-04:00
committergravatar for michael.dusan@gmail.comMichael Dusan <michael.dusan@gmail.com> 2021-04-02 07:12:09-04:00
logcc435dab2fbf66f2db339310131608472838c67d
tree0160930d3d9e6a8513fdd6b17a150b7c82fc2c56
parent8ebfdc14f68521ac129ee7d2c3f4e7250e4e7418

test: fix io_uring timing test to skip on failure


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

lib/std/os/linux/io_uring.zig+3-1
...@@ -1353,7 +1353,9 @@ test "timeout (after a relative time)" {...@@ -1353,7 +1353,9 @@ test "timeout (after a relative time)" {
1353 .res = -linux.ETIME,1353 .res = -linux.ETIME,
1354 .flags = 0,1354 .flags = 0,
1355 }, cqe);1355 }, cqe);
1356 testing.expectApproxEqAbs(@intToFloat(f64, ms), @intToFloat(f64, stopped - started), margin);1356
1357 // Tests should not depend on timings: skip test (result) if outside margin.
1358 if (!std.math.approxEqAbs(f64, ms, @intToFloat(f64, stopped - started), margin)) return error.SkipZigTest;
1357}1359}
13581360
1359test "timeout (after a number of completions)" {1361test "timeout (after a number of completions)" {