]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephfs/test_sessionmap: reap connections immediately 43310/head
authorSage Weil <sage@newdream.net>
Wed, 19 May 2021 19:27:56 +0000 (15:27 -0400)
committerGerald Yang <gerald.yang.tw@gmail.com>
Mon, 27 Sep 2021 07:32:43 +0000 (07:32 +0000)
We have to reap connections promptly for this test to work.

This test was broken indirectly by d51d80b3234e17690061f65dc7e1515f4244a5a3,
which moved the counter decrement to reap time instead of mark_down/stop
time.

The reaping is asynchronous, so allow for a delay in the count change.

Fixes: https://tracker.ceph.com/issues/50622
Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit c8c5071dcd4b0b788f5e924a678095ce5dc1d7f8)
Signed-off-by: Gerald Yang <gerald.yang.tw@gmail.com>
qa/tasks/cephfs/test_sessionmap.py

index 87e789770b50aeb2ff2f8b718f8b323f73760c5b..36d2fceb25fc6b7cbce4193a23588ff204f714e8 100644 (file)
@@ -42,21 +42,26 @@ class TestSessionMap(CephFSTestCase):
         the conn count goes back to where it started (i.e. we aren't
         leaving connections open)
         """
+        self.config_set('mds', 'ms_async_reap_threshold', '1')
+
         self.mount_a.umount_wait()
         self.mount_b.umount_wait()
 
         status = self.fs.status()
         s = self._get_connection_count(status=status)
         self.fs.rank_tell(["session", "ls"], status=status)
-        e = self._get_connection_count(status=status)
-
-        self.assertEqual(s, e)
+        self.wait_until_true(
+            lambda: self._get_connection_count(status=status) == s,
+            timeout=30
+        )
 
     def test_mount_conn_close(self):
         """
         That when a client unmounts, the thread count on the MDS goes back
         to what it was before the client mounted
         """
+        self.config_set('mds', 'ms_async_reap_threshold', '1')
+
         self.mount_a.umount_wait()
         self.mount_b.umount_wait()
 
@@ -65,9 +70,10 @@ class TestSessionMap(CephFSTestCase):
         self.mount_a.mount_wait()
         self.assertGreater(self._get_connection_count(status=status), s)
         self.mount_a.umount_wait()
-        e = self._get_connection_count(status=status)
-
-        self.assertEqual(s, e)
+        self.wait_until_true(
+            lambda: self._get_connection_count(status=status) == s,
+            timeout=30
+        )
 
     def test_version_splitting(self):
         """