Re: [PATCH 2/2] test/timeout-swallow: verify -ETIME is not swallowed
Gabriel Krisman Bertazi <[email protected]> Tue, 14 Jul 2026 12:20:25 -0400
| Newsgroups | org.kernel.vger.io-uring |
|---|---|
| Organization | SUSE |
| Message-ID | <[email protected]> |
Prateek <[email protected]> writes: > Regression test for the previous commit. Submits an SQE and waits with a > zero timeout for more completions than can arrive; the result must be > -ETIME, not the positive submit count. Covers the normal EXT_ARG wait > path and the registered-wait path, each skipped gracefully where > unsupported. > > Signed-off-by: Prateek <[email protected]> > --- > test/Makefile | 1 + > test/timeout-swallow.c | 117 +++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 118 insertions(+) > create mode 100644 test/timeout-swallow.c > > diff --git a/test/Makefile b/test/Makefile > index d6358a93..ae23ef6d 100644 > --- a/test/Makefile > +++ b/test/Makefile > @@ -293,6 +293,7 @@ test_srcs := \ > timerfd-short-read.c \ > timeout.c \ > timeout-new.c \ > + timeout-swallow.c \ > timestamp.c \ > timestamp-bug.c \ > truncate.c \ > diff --git a/test/timeout-swallow.c b/test/timeout-swallow.c > new file mode 100644 > index 00000000..9fb4ab01 > --- /dev/null > +++ b/test/timeout-swallow.c > @@ -0,0 +1,117 @@ > +/* SPDX-License-Identifier: MIT */ > +/* > + * Description: tests that io_uring_wait_cqes() and variants do not swallow > + * -ETIME when loop-fetching CQEs if some SQEs were submitted. > + */ > +#include <stdio.h> > +#include <unistd.h> > +#include <errno.h> > +#include <sys/time.h> > +#include "liburing.h" > +#include "helpers.h" > + > +/* > + * Test the normal -ETIME swallow path. (line 118 in queue.c) This type of comment is useless as line number changes. Better to refer to function name in the API and describe the situation or not have anything at all. Other than that, Reviewed-by: Gabriel Krisman Bertazi <[email protected]> -- Gabriel Krisman Bertazi