From: Venky Shankar Date: Tue, 24 Feb 2026 08:27:16 +0000 (+0530) Subject: qa: use safe_while() to avoid racy checks in test_subvolume_metrics_lifecycle() X-Git-Tag: v21.0.0~159^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2850b3f529b898f53eb4b4a4c302f280b8bc6469;p=ceph.git qa: use safe_while() to avoid racy checks in test_subvolume_metrics_lifecycle() Signed-off-by: Venky Shankar --- diff --git a/qa/tasks/cephfs/test_subvolume.py b/qa/tasks/cephfs/test_subvolume.py index 08680615af15..bbb7f0db9b9f 100644 --- a/qa/tasks/cephfs/test_subvolume.py +++ b/qa/tasks/cephfs/test_subvolume.py @@ -411,12 +411,12 @@ class TestSubvolumeMetrics(CephFSTestCase): self.assertEqual(counters_after_delete["quota_bytes"], quota_bytes, "Quota should remain unchanged after deletions") - # wait for metrics to expire after inactivity - sleep(30) - # verify that metrics are not present anymore - subvolume_metrics = self.get_subvolume_metrics() - self.assertFalse(subvolume_metrics, "Subvolume metrics should be gone after inactivity window") + with safe_while(sleep=1, tries=60, action='wait for empty subvolume metrics after inactivity window') as proceed: + while proceed(): + subvolume_metrics = self.get_subvolume_metrics() + if not subvolume_metrics: + break def test_subvolume_quota_resize_update(self): """