]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: wait for purge queue operations to finish 44642/head
authorVenky Shankar <vshankar@redhat.com>
Tue, 23 Nov 2021 09:37:01 +0000 (04:37 -0500)
committerVenky Shankar <vshankar@redhat.com>
Tue, 18 Jan 2022 13:42:16 +0000 (08:42 -0500)
TestFragmentation.test_deep_split relies on `num_strays`
to reach zero expecting that the purge threads would
have deleted the directory entries. However, checking
`num_strays` cannot be relied on since PurqeQueue merely
journals the purge item (see PurgeQueue::push) followed
by the StrayManager marking the stray as removed thereby
accounting `num_strays`.

So, add an additional condition to check if the purge
threads have finished processing items.

Fixes: http://tracker.ceph.com/issues/52487
Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit d9c79983230a9237422998771db4b4c450aed949)

qa/tasks/cephfs/test_fragment.py

index 41977ca202836d8e51642c7aafea640f1db65033..1102f887b5f0a6cd28ac2f20cc5ba6a22a0ae6d5 100644 (file)
@@ -214,11 +214,14 @@ class TestFragmentation(CephFSTestCase):
 
         self.fs.mds_asok(['flush', 'journal'])
 
+        def _check_pq_finished():
+            num_strays = self.fs.mds_asok(['perf', 'dump', 'mds_cache'])['mds_cache']['num_strays']
+            pq_ops = self.fs.mds_asok(['perf', 'dump', 'purge_queue'])['purge_queue']['pq_executing']
+            return num_strays == 0 and pq_ops == 0
+
         # Wait for all strays to purge
-        self.wait_until_equal(
-            lambda: self.fs.mds_asok(['perf', 'dump', 'mds_cache']
-                                     )['mds_cache']['num_strays'],
-            0,
+        self.wait_until_true(
+            lambda: _check_pq_finished(),
             timeout=1200
         )
         # Check that the metadata pool objects for all the myriad