From: Venky Shankar Date: Wed, 23 Aug 2023 10:27:21 +0000 (-0400) Subject: qa: add test to validate periodic checks by async threads X-Git-Tag: v19.0.0~465^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=82fa0661b200616379c8f506151e8b35ef4860cc;p=ceph-ci.git qa: add test to validate periodic checks by async threads Signed-off-by: Venky Shankar --- diff --git a/qa/tasks/cephfs/test_volumes.py b/qa/tasks/cephfs/test_volumes.py index 1213f5ef03a..a360f9fa4b4 100644 --- a/qa/tasks/cephfs/test_volumes.py +++ b/qa/tasks/cephfs/test_volumes.py @@ -7366,6 +7366,29 @@ class TestSubvolumeSnapshotClones(TestVolumesHelper): max_concurrent_clones = int(self.config_get('mgr', 'mgr/volumes/max_concurrent_clones')) self.assertEqual(max_concurrent_clones, 2) + def test_periodic_async_work(self): + """ + to validate that the async thread (purge thread in this case) will + process a job that's manually created. + """ + + self.config_set('mgr', 'mgr/volumes/periodic_async_work', True) + + trashdir = os.path.join("./", "volumes", "_deleting") + entry = os.path.join(trashdir, "subvol") + # hand create the directory + self.mount_a.run_shell(['sudo', 'mkdir', '-p', entry], omit_sudo=False) + + # verify trash dir is processed + self._wait_for_trash_empty() + + self.config_set('mgr', 'mgr/volumes/periodic_async_work', False) + + # wait a bit so that the default wakeup time (5s) is consumed + # by the async threads (i.e., the default gets honoured before + # the file system gets purged). + time.sleep(10) + def test_subvolume_under_group_snapshot_clone(self): subvolume = self._generate_random_subvolume_name() group = self._generate_random_group_name()