[PATCH liburing] timeout/test: clear state for timeout updates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux