From de6992bc698789d4b1ff8363f83908bfc8cbca35 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Wed, 28 Jun 2023 07:56:56 +0100 Subject: [PATCH] qa: improve test_join_fs_last_resort Check the former active will reclaim its spot eventually. Signed-off-by: Mykola Golub (cherry picked from commit 929963497868af655dbcca978abd057376f1e48e) --- qa/tasks/cephfs/test_failover.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/qa/tasks/cephfs/test_failover.py b/qa/tasks/cephfs/test_failover.py index ddcc58cccc507..68483d3308276 100644 --- a/qa/tasks/cephfs/test_failover.py +++ b/qa/tasks/cephfs/test_failover.py @@ -151,8 +151,14 @@ class TestClusterAffinity(CephFSTestCase): ranks = list(self.fs.get_ranks(status=status)) self.assertEqual(len(ranks), 1) self.assertIn(ranks[0]['name'], standbys) - # Note that we would expect the former active to reclaim its spot, but - # we're not testing that here. + + # Wait for the former active to reclaim its spot + def reclaimed(): + ranks = list(self.fs.get_ranks()) + return len(ranks) > 0 and ranks[0]['name'] not in standbys + + log.info("Waiting for former active to reclaim its spot") + self.wait_until_true(reclaimed, timeout=self.fs.beacon_timeout) def test_join_fs_steady(self): """ -- 2.39.5