From 586b111e1bba6471284de47f56f5bc01661f4dcf Mon Sep 17 00:00:00 2001 From: NitzanMordhai Date: Thu, 18 Aug 2022 11:33:15 +0000 Subject: [PATCH] pybind/rados: notify callback reconnect when testing with socket injection, reconnect won't call error callback for each reconnect, the callback will be called. changing the callback count of notify by the data and increass only when the data is changed, if the data is the same, we probably reconnecting due to socket injection. Fixes: https://tracker.ceph.com/issues/45721 Signed-off-by: Nitzan Mordechai (cherry picked from commit 583b903ff758d1437c411fa7a2e2aff770844d4d) --- src/test/pybind/test_rados.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/pybind/test_rados.py b/src/test/pybind/test_rados.py index 099691490565..0d91a33bb842 100644 --- a/src/test/pybind/test_rados.py +++ b/src/test/pybind/test_rados.py @@ -1328,6 +1328,7 @@ class TestCommand(object): eq(u"pool '\u9ec5' created", out) +@attr('watch') class TestWatchNotify(object): OID = "test_watch_notify" @@ -1356,8 +1357,9 @@ class TestWatchNotify(object): def callback(notify_id, notifier_id, watch_id, data): with self.lock: if watch_id not in self.notify_cnt: - self.notify_cnt[watch_id] = 0 - self.notify_cnt[watch_id] += 1 + self.notify_cnt[watch_id] = 1 + elif self.notify_data[watch_id] != data: + self.notify_cnt[watch_id] += 1 self.notify_data[watch_id] = data return callback -- 2.47.3