From: Patrick Donnelly Date: Fri, 7 Jul 2017 21:43:55 +0000 (-0700) Subject: qa: wait for OSDMap to propagate for snap purge X-Git-Tag: v12.1.2~177^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F16226%2Fhead;p=ceph.git qa: wait for OSDMap to propagate for snap purge Note: unmounting the client is not necessary for purging snapshots. Fixes: http://tracker.ceph.com/issues/20072 Signed-off-by: Patrick Donnelly --- diff --git a/qa/tasks/cephfs/test_strays.py b/qa/tasks/cephfs/test_strays.py index b8538f5353a..b64f3e931dc 100644 --- a/qa/tasks/cephfs/test_strays.py +++ b/qa/tasks/cephfs/test_strays.py @@ -785,18 +785,23 @@ class TestStrays(CephFSTestCase): # Remove the snapshot self.mount_a.run_shell(["rmdir", "snapdir/.snap/snap1"]) - self.mount_a.umount_wait() # Purging file_a doesn't happen until after we've flushed the journal, because # it is referenced by the snapshotted subdir, and the snapshot isn't really # gone until the journal references to it are gone self.fs.mds_asok(["flush", "journal"]) + # Wait for purging to complete, which requires the OSDMap to propagate to the OSDs. + # See also: http://tracker.ceph.com/issues/20072 + self.wait_until_true( + lambda: self.fs.data_objects_absent(file_a_ino, size_mb * 1024 * 1024), + timeout=60 + ) + # See that a purge happens now self._wait_for_counter("mds_cache", "strays_enqueued", 2) self._wait_for_counter("purge_queue", "pq_executed", 2) - self.assertTrue(self.fs.data_objects_absent(file_a_ino, size_mb * 1024 * 1024)) self.await_data_pool_empty() def test_fancy_layout(self):