From: Sage Weil Date: Wed, 19 May 2021 19:27:56 +0000 (-0400) Subject: qa/tasks/cephfs/test_sessionmap: reap connections immediately X-Git-Tag: v17.1.0~1666^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c8c5071dcd4b0b788f5e924a678095ce5dc1d7f8;p=ceph.git qa/tasks/cephfs/test_sessionmap: reap connections immediately 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 --- diff --git a/qa/tasks/cephfs/test_sessionmap.py b/qa/tasks/cephfs/test_sessionmap.py index 79f1fb45e243a..ad6fd1d609cb9 100644 --- a/qa/tasks/cephfs/test_sessionmap.py +++ b/qa/tasks/cephfs/test_sessionmap.py @@ -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): """