public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH liburing] tests: fix test_cancel_req_across_fork
@ 2021-08-21 14:22 Pavel Begunkov
  2021-08-21 14:35 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2021-08-21 14:22 UTC (permalink / raw)
  To: Jens Axboe, io-uring

Rarely, the request we're trying to cancel may not yet got picked by
a worker, and so the cancel request returns 0 instead of -EALREADY, and
it's a valid output we should consider.

Signed-off-by: Pavel Begunkov <[email protected]>
---
 test/io-cancel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/io-cancel.c b/test/io-cancel.c
index 9a36dd9..a4cc361 100644
--- a/test/io-cancel.c
+++ b/test/io-cancel.c
@@ -339,7 +339,7 @@ static int test_cancel_req_across_fork(void)
 				return 1;
 			}
 			if ((cqe->user_data == 1 && cqe->res != -EINTR) ||
-			    (cqe->user_data == 2 && cqe->res != -EALREADY)) {
+			    (cqe->user_data == 2 && cqe->res != -EALREADY && cqe->res)) {
 				fprintf(stderr, "%i %i\n", (int)cqe->user_data, cqe->res);
 				exit(1);
 			}
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-21 14:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-21 14:22 [PATCH liburing] tests: fix test_cancel_req_across_fork Pavel Begunkov
2021-08-21 14:35 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox