From 7acd445fcc3c7cc5c70ac1de442a878c7c52dece Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Tue, 13 Oct 2020 16:11:43 +0800 Subject: [PATCH] qa/tasks: tear down the background process before unmounting If the background process keeps running by opening the mountpoint directory, the unmount will fail with BUSY. Fixes: https://tracker.ceph.com/issues/46883 Signed-off-by: Xiubo Li --- qa/tasks/cephfs/kernel_mount.py | 4 ++-- qa/tasks/cephfs/test_client_recovery.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/qa/tasks/cephfs/kernel_mount.py b/qa/tasks/cephfs/kernel_mount.py index 33c557c2d34..2218e057f8c 100644 --- a/qa/tasks/cephfs/kernel_mount.py +++ b/qa/tasks/cephfs/kernel_mount.py @@ -66,9 +66,9 @@ class KernelMount(CephFSMount): self.mounted = True def _run_mount_cmd(self, mntopts, check_status): - opts = 'norequire_active_mds,' + opts = 'norequire_active_mds' if self.client_id: - opts += 'name=' + self.client_id + opts += ',name=' + self.client_id if self.client_keyring_path and self.client_id: opts += ',secret=' + self.get_key_from_keyfile() if self.config_path: diff --git a/qa/tasks/cephfs/test_client_recovery.py b/qa/tasks/cephfs/test_client_recovery.py index 65ae312d4ec..ab2fe239c1c 100644 --- a/qa/tasks/cephfs/test_client_recovery.py +++ b/qa/tasks/cephfs/test_client_recovery.py @@ -414,6 +414,9 @@ class TestClientRecovery(CephFSTestCase): # succeed self.wait_until_true(lambda: lock_taker.finished, timeout=10) finally: + # Tear down the background process + self.mount_a._kill_background(lock_holder) + # teardown() doesn't quite handle this case cleanly, so help it out self.mount_a.kill() self.mount_a.kill_cleanup() -- 2.39.5