]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephfs/test_sessionmap: reap connections immediately 41422/head
authorSage Weil <sage@newdream.net>
Wed, 19 May 2021 19:27:56 +0000 (15:27 -0400)
committerSage Weil <sage@newdream.net>
Fri, 4 Jun 2021 15:02:29 +0000 (11:02 -0400)
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>
qa/tasks/cephfs/test_sessionmap.py

index 79f1fb45e243a05f57a32b30c0b464f6de2f80cf..ad6fd1d609cb9b21701caed068a68cde1fa6285d 100644 (file)
@@ -41,21 +41,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()
 
@@ -64,9 +69,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):
         """