]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/neorados: timeout test won't reconnect at timeout 56982/head
authorNitzan Mordechai <nmordech@redhat.com>
Thu, 18 Apr 2024 12:52:42 +0000 (12:52 +0000)
committerNitzan Mordechai <nmordech@redhat.com>
Thu, 18 Apr 2024 12:52:48 +0000 (12:52 +0000)
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 <nmordech@redhat.com>
src/test/neorados/watch_notify.cc

index 284b9436edc77eeb62c880b97203dc8d5ec9fada..901a1e7491ae7c4155638b1e815172c47b980883 100644 (file)
@@ -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<void> 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);