From 39f00fcc718eef880f6c90a2619b76520091dd8e Mon Sep 17 00:00:00 2001 From: NitzanMordhai Date: Wed, 19 Oct 2022 12:42:16 +0000 Subject: [PATCH] tests: ceph_test_rados_api_watch_notify LibRadosWatchNotify.AioWatchDelete reconnect During test LibRadosWatchNotify.AioWatchDelete rados_watch_check can return error -102 if reconnect happened, in that case Broken pipe reconnect and -102 returned Signed-off-by: Nitzan Mordechai (cherry picked from commit 0184c4bd930f5840e4b21a808db3f6d7d484bfce) --- src/test/librados/watch_notify.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/test/librados/watch_notify.cc b/src/test/librados/watch_notify.cc index 79cdd5abe75a2..90c28be37eae9 100644 --- a/src/test/librados/watch_notify.cc +++ b/src/test/librados/watch_notify.cc @@ -240,7 +240,10 @@ TEST_F(LibRadosWatchNotify, AioWatchDelete) { } 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)); -- 2.39.5