]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: ceph_test_rados_api_watch_notify: Allow for reconnect 40697/head
authorBrad Hubbard <bhubbard@redhat.com>
Mon, 22 Feb 2021 03:28:12 +0000 (13:28 +1000)
committerNathan Cutler <ncutler@suse.com>
Thu, 8 Apr 2021 16:18:08 +0000 (18:18 +0200)
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>
(cherry picked from commit 0a03a81f633f11bd3247b2f8f10f719c7b3d38e3)

Conflicts:
src/test/librados/watch_notify.cc
- in nautilus, we call rados_aio_create_completion() instead of
  rados_aio_create_completion2()

src/test/librados/watch_notify.cc

index 6e5a7dcc20b8376a07578a71e3d47837686316db..c19a693b536c93c9b2d7e5283863542afc619606 100644 (file)
@@ -590,7 +590,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_completion(NULL, NULL, NULL, &comp));
   rados_aio_unwatch(ioctx, handle, comp);
   ASSERT_EQ(0, rados_aio_wait_for_complete(comp));