]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: improve test_join_fs_last_resort
authorMykola Golub <mykola.golub@clyso.com>
Wed, 28 Jun 2023 06:56:56 +0000 (07:56 +0100)
committerMykola Golub <mgolub@suse.com>
Fri, 3 Nov 2023 16:33:25 +0000 (18:33 +0200)
Check the former active will reclaim its spot eventually.

Signed-off-by: Mykola Golub <mykola.golub@clyso.com>
(cherry picked from commit 929963497868af655dbcca978abd057376f1e48e)

qa/tasks/cephfs/test_failover.py

index ddcc58cccc5076565084fd670a4c5cf8ff24cb7f..68483d33082767bef0869e3065e0f509a372cbdf 100644 (file)
@@ -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):
         """