]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: ceph_test_rados_api_watch_notify: Allow for reconnect 39601/head
authorBrad Hubbard <bhubbard@redhat.com>
Mon, 22 Feb 2021 03:28:12 +0000 (13:28 +1000)
committerBrad Hubbard <bhubbard@redhat.com>
Mon, 22 Feb 2021 03:28:12 +0000 (13:28 +1000)
An injected socket failure may cause rados_watch_check() to return
ENOENT instead of the expected ENOTCONN.

Fixes: https://tracker.ceph.com/issues/47719
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
src/test/librados/watch_notify.cc

index c87fb40aebf79af37d6d1f9c7b14c5741086f9e0..e5ea22744a04395d799340141e361ea42788b8ab 100644 (file)
@@ -589,7 +589,10 @@ TEST_F(LibRadosWatchNotify, AioWatchDelete2) {
   }
   ASSERT_TRUE(left > 0);
   ASSERT_EQ(-ENOTCONN, notify_err);
-  ASSERT_EQ(-ENOTCONN, rados_watch_check(ioctx, handle));
+  int rados_watch_check_err = rados_watch_check(ioctx, handle);
+  // We may hit ENOENT due to socket failure injection and a forced reconnect
+  EXPECT_TRUE(rados_watch_check_err == -ENOTCONN || rados_watch_check_err == -ENOENT)
+    << "Where rados_watch_check_err = " << rados_watch_check_err;
   ASSERT_EQ(0, rados_aio_create_completion2(nullptr, nullptr, &comp));
   rados_aio_unwatch(ioctx, handle, comp);
   ASSERT_EQ(0, rados_aio_wait_for_complete(comp));