public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH liburing] timeout/test: clear state for timeout updates
Date: Tue,  8 Dec 2020 21:57:14 +0000	[thread overview]
Message-ID: <671c1670b4f205411ef93deed9f3bef5603d7a19.1607464429.git.asml.silence@gmail.com> (raw)

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 <[email protected]>
---
 test/timeout.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/test/timeout.c b/test/timeout.c
index b80fc36..9c8211c 100644
--- a/test/timeout.c
+++ b/test/timeout.c
@@ -1260,6 +1260,14 @@ int main(int argc, char *argv[])
 		return ret;
 	}
 
+	/* io_uring_wait_cqes() may have left a timeout, reinit ring */
+	io_uring_queue_exit(&ring);
+	ret = io_uring_queue_init(8, &ring, 0);
+	if (ret) {
+		fprintf(stderr, "ring setup failed\n");
+		return 1;
+	}
+
 	ret = test_update_nonexistent_timeout(&ring);
 	has_timeout_update = (ret != -EINVAL);
 	if (has_timeout_update) {
-- 
2.24.0


             reply	other threads:[~2020-12-08 22:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-08 21:57 Pavel Begunkov [this message]
2020-12-08 22:44 ` [PATCH liburing] timeout/test: clear state for timeout updates Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=671c1670b4f205411ef93deed9f3bef5603d7a19.1607464429.git.asml.silence@gmail.com \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox