]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: add test to validate periodic checks by async threads 61230/head
authorVenky Shankar <vshankar@redhat.com>
Wed, 23 Aug 2023 10:27:21 +0000 (06:27 -0400)
committerVenky Shankar <vshankar@redhat.com>
Thu, 12 Jun 2025 10:40:02 +0000 (10:40 +0000)
Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit 82fa0661b200616379c8f506151e8b35ef4860cc)

qa/tasks/cephfs/test_volumes.py

index 612a4ef41d4bb66736eb75d7169b78fc23d77bd0..f1da7a805053936682e3f50917c07502c6300957 100644 (file)
@@ -7491,6 +7491,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._gen_subvol_name()
         group = self._gen_subvol_grp_name()