tests: test early-submit link fails
PATCH v2 1/1 tests: test early-submit link fails
Add a whole bunch of tests for when linked requests fail early during submission.
---
v2: correct io_uring_submit() ret checks with !drain
.gitignore | 1 + test/Makefile | 2 + test/submit-link-fail.c | 150 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 test/submit-link-fail.c
.gitignore +1 -0
@@ -128,6 +128,7 @@ /test/rw_merge_test /test/sqpoll-cancel-hang /test/testfile +/test/submit-link-fail /test/*.dmesg config-host.h
test/Makefile +2 -0
@@ -123,6 +123,7 @@ test_targets += \ sq-space_left \ stdout \ submit-reuse \ + submit-link-fail \ symlink \ teardowns \ thread-exit \
@@ -264,6 +265,7 @@ test_srcs := \ statx.c \ stdout.c \ submit-reuse.c \ + submit-link-fail.c \ symlink.c \ teardowns.c \ thread-exit.c \
test/submit-link-fail.c new file +150 -0
150 lines not on this page · raw message
Signature · 1 line
2.33.0
Quoted 2 lines · Pavel Begunkov
Add a whole bunch of tests for when linked requests fail early during submission.
Applied, but remember to check write(2) returns:
submit-link-fail.c: In function ‘test_underprep_fail’:
submit-link-fail.c:80:17: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
80 | write(fds[1], buffer, sizeof(buffer));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Signature · 1 line
Jens Axboe
Quoted 10 lines · Jens Axboe
Quoted 2 lines · Pavel Begunkov
Add a whole bunch of tests for when linked requests fail early during submission.
Applied, but remember to check write(2) returns:
submit-link-fail.c: In function ‘test_underprep_fail’:
submit-link-fail.c:80:17: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]80 | write(fds[1], buffer, sizeof(buffer)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My bad. Interesting why my gcc 11 doesn't complain.
Signature · 1 line
Pavel Begunkov
Quoted 8 lines · Pavel Begunkov
Add a whole bunch of tests for when linked requests fail early during submission.
Signed-off-by Pavel Begunkov <[email protected]>---
v2: correct
io_uring_submit()ret checks with !drain
Thanks for this test.