A previous commit renamed all test targets to foo.t, but didn't update
the timeout test case. Hence it now tries to exec something that isn't
there and rightfully complains about it:
Running test timeout.t Can't find exec-target, skipping
Update the test to use the right target.
Fixes: e2ada03c9d ("test/Makefile: Append `.t` to the test binary")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Fix this:
```
timeout.c: In function ‘test_multi_timeout’:
timeout.c:590:20: warning: ‘user_data’ may be used uninitialized in this function [-Wmaybe-uninitialized]
590 | if (cqe->user_data != user_data) {
| ^
timeout.c:601:51: warning: ‘time’ may be used uninitialized in this function [-Wmaybe-uninitialized]
601 | if (exp < time / 2 || exp > (time * 3) / 2) {
| ~~~~~~^~~~
```
Fixes: 37136cb442 ("test/timeout: add multi timeout reqs test with different timeout")
Cc: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Ammar Faizi <ammar.faizi@students.amikom.ac.id>
Link: https://lore.kernel.org/r/hgUsvvrR9xY-ammarfaizi2@gnuweeb.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
The test is currently broken because it assumes that it's in the
same directory, that's never the case if the test is run from the
make runtests target.
Try both ./exec-target and test/exec-target, that should make it work
more reliably.
Fixes: fa4a89bea5 ("tests: test timeout cancellation fails links")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This test case catches an issue where timeouts may not be flushed
if the number of new events is greater (not equal) to the number
of events requested in the timeout.
Signed-off-by: Marcelo Diop-Gonzalez <marcelo827@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Clear the ring before test_update_nonexistent_timeout(), because
otherwise previous test_single_timeout_wait() may leave an internal
timeout, that would fire and fail the test with -ETIME.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Test timeout updates if supported. Fuzzy checks that it sustains
specified timings. Tests async/linked update, rel/abs, short and longer
delays.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Rename the io_uring_* system calls to __sys_io_uring_* and make them
locals.
We only have the system calls because they are not in glibc yet, and
it's somewhat confusing that they share the same namespace as the
library functions. With this change, any exported io_uring_* function
is a library function.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Small fix to make sure correct ts structure is filled with correct values.
Signed-off-by: Hrvoje Zeba <zeba.hrvoje@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Add multi timeout reqs test case which want to test submitting timeout
reqs with different count number, check the return sequence and the
status of each req.
Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Add multi timeout reqs test case which want to test submitting timeout
reqs with different timeout value, check the return sequence and the
status of each req.
Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
We made a kernel change to support timeouts properly on 32-bit
archs, update liburing to use __kernel_timespec instead of the
differently sized timespec.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
We also need the sigset for certain setups, and adding a third
option is pretty crazy. Since io_uring_wait_cqes_timeout() isn't
in a released version yet (and neither is io_uring_wait_cqes()),
make the necessary adjustments.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
We call this internally after queueing the timeout SQE anyway, so
the application doesn't have to do it upfront.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Like io_uring_wait_cqe(), except it accepts a timeout value as well. Note
that an sqe is used internally to handle the timeout. Applications using
this function must never set sqe->user_data to LIBURING_UDATA_TIMEOUT!
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Add support for the current TIMEOUT variant. This allows passing
in a timeout and event count, first of which will trigger the
completion of the timeout command.
If the timeout is hit, the command completes with cqe->res == -ETIME.
If the asked number of events complete first, the command completes
with cqe->res == 0.
test/timeout.c tests a variety of timeout conditions.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
We need a wakeup even if we don't hit the desired number of
available commands if a timeout has triggered. Add a test case
for that.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
In my testing, we're always right on 1000 msec, but allow some slack
and just judge it good if we're within +- 50%.
Signed-off-by: Jens Axboe <axboe@kernel.dk>