From 8c8414a953f198113cec038f83e78e52127f3cc4 Mon Sep 17 00:00:00 2001 From: NitzanMordhai Date: Sun, 13 Mar 2022 08:52:59 +0000 Subject: [PATCH] tests: ceph_test_rados_api_watch_notify: watch2Delete reconnect During test LibRadosWatchNotify.Watch2Delete rados_watch_check can return error -102 if reconnect happened, in that case Broken pipe reconnect and -102 returned Fixes: https://tracker.ceph.com/issues/51307 Signed-off-by: Nitzan Mordechai Signed-off-by: NitzanMordhai --- 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 3797e37c583..d9bf58c5d1b 100644 --- a/src/test/librados/watch_notify.cc +++ b/src/test/librados/watch_notify.cc @@ -162,7 +162,10 @@ TEST_F(LibRadosWatchNotify, Watch2Delete) { } 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 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; rados_unwatch2(ioctx, handle); rados_watch_flush(cluster); } -- 2.39.5