From: Yan, Zheng Date: Wed, 13 Sep 2017 08:34:40 +0000 (+0800) Subject: qa/cephfs: kill mount if it gets evicted by mds X-Git-Tag: v12.2.1~11^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F17822%2Fhead;p=ceph.git qa/cephfs: kill mount if it gets evicted by mds otherwise, teardown() hange at umount Fixes: http://tracker.ceph.com/issues/21275 Signed-off-by: "Yan, Zheng" (cherry picked from commit 98d86a075242f0c4576814db15cc3f8fd8e06017) --- diff --git a/qa/tasks/cephfs/test_client_recovery.py b/qa/tasks/cephfs/test_client_recovery.py index 4940ab89b7cb..fd58c1427338 100644 --- a/qa/tasks/cephfs/test_client_recovery.py +++ b/qa/tasks/cephfs/test_client_recovery.py @@ -395,14 +395,21 @@ class TestClientRecovery(CephFSTestCase): self.assertFalse(lock_holder.finished) self.assertFalse(lock_taker.finished) - mount_a_client_id = self.mount_a.get_global_id() - self.fs.mds_asok(['session', 'evict', "%s" % mount_a_client_id]) + try: + mount_a_client_id = self.mount_a.get_global_id() + self.fs.mds_asok(['session', 'evict', "%s" % mount_a_client_id]) - # Evicting mount_a should let mount_b's attepmt to take the lock - # suceed - self.wait_until_true( - lambda: lock_taker.finished, - timeout=10) + # Evicting mount_a should let mount_b's attempt to take the lock + # succeed + self.wait_until_true(lambda: lock_taker.finished, timeout=10) + finally: + # teardown() doesn't quite handle this case cleanly, so help it out + self.mount_a.kill() + self.mount_a.kill_cleanup() + + # Bring the client back + self.mount_a.mount() + self.mount_a.wait_until_mounted() def test_dir_fsync(self): self._test_fsync(True);