From: Nitzan Mordechai Date: Thu, 18 Apr 2024 12:52:42 +0000 (+0000) Subject: test/neorados: timeout test won't reconnect at timeout X-Git-Tag: v20.0.0~1505^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=17c64fff56cbb144840670a7c0b4446d35eafe1d;p=ceph.git test/neorados: timeout test won't reconnect at timeout Watch-notify tests involve waiting for a notification within a certain timeout period. However, if an error occurs before receiving the notification acknowledgment, attempting to reconnect may lead to unpredictable errors. Fixes: https://tracker.ceph.com/issues/65449 Signed-off-by: Nitzan Mordechai --- diff --git a/src/test/neorados/watch_notify.cc b/src/test/neorados/watch_notify.cc index 284b9436edc7..901a1e7491ae 100644 --- a/src/test/neorados/watch_notify.cc +++ b/src/test/neorados/watch_notify.cc @@ -54,6 +54,7 @@ protected: const std::string notify_oid = "foo"s; sys::error_code notify_err; ceph::timespan notify_sleep = 0s; + bool should_reconnet = true; asio::awaitable handle_notify(uint64_t notify_id, uint64_t cookie, uint64_t notifier_gid, buffer::list&& bl) { @@ -73,6 +74,9 @@ protected: std::cout << __func__ << " cookie " << cookie << " err " << ec.message() << std::endl; ceph_assert(cookie > 1000); + if (!should_reconnet) { + co_return; + } co_await rados().unwatch(cookie, pool(), asio::use_awaitable); notify_cookies.erase(cookie); notify_err = ec; @@ -154,6 +158,7 @@ CORO_TEST_F(NeoRadosWatchNotify, WatchNotifyTimeout, NeoRadosWatchNotifyTest) { sys::errc::timed_out); std::cout << "Timed out." << std::endl; + should_reconnet = false; // Don't reconnect, we know we will timeout EXPECT_TRUE(rados().check_watch(handle)); co_await rados().unwatch(handle, pool(), asio::use_awaitable);