From: Jos Collin Date: Tue, 6 May 2025 11:50:39 +0000 (+0530) Subject: qa: fix test_cephfs_mirror_stats failure X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9738b8d36275fda42d847058aab55ba1e6e6e7fc;p=ceph.git qa: fix test_cephfs_mirror_stats failure * Don't create huge files that results in 'No space left on device'. * Relax last_synced_end > last_synced_start check, so that the test wouldn't fail even if 'counter dump' delays getting updated values within a particular snapshot sync. Fixes: https://tracker.ceph.com/issues/71186 Signed-off-by: Jos Collin --- diff --git a/qa/tasks/cephfs/test_mirroring.py b/qa/tasks/cephfs/test_mirroring.py index 4d17a9a902f0c..83ea754433bb7 100644 --- a/qa/tasks/cephfs/test_mirroring.py +++ b/qa/tasks/cephfs/test_mirroring.py @@ -589,7 +589,7 @@ class TestMirroring(CephFSTestCase): # create a bunch of files in a directory to snap self.mount_a.run_shell(["mkdir", "d0"]) for i in range(10): - self.mount_a.write_n_mb(os.path.join('d0', f'file.{i}'), 1024) + self.mount_a.write_n_mb(os.path.join('d0', f'file.{i}'), 100) time.sleep(60) self.enable_mirroring(self.primary_fs_name, self.primary_fs_id) @@ -603,7 +603,7 @@ class TestMirroring(CephFSTestCase): # take a snapshot self.mount_a.run_shell(["mkdir", "d0/.snap/snap0"]) - time.sleep(500) + time.sleep(120) self.check_peer_status(self.primary_fs_name, self.primary_fs_id, "client.mirror_remote@ceph", '/d0', 'snap0', 1) self.verify_snapshot('d0', 'snap0') @@ -613,20 +613,20 @@ class TestMirroring(CephFSTestCase): second = res[TestMirroring.PERF_COUNTER_KEY_NAME_CEPHFS_MIRROR_PEER][0] self.assertGreater(second["counters"]["snaps_synced"], first["counters"]["snaps_synced"]) self.assertGreater(second["counters"]["last_synced_start"], first["counters"]["last_synced_start"]) - self.assertGreater(second["counters"]["last_synced_end"], second["counters"]["last_synced_start"]) + self.assertGreaterEqual(second["counters"]["last_synced_end"], second["counters"]["last_synced_start"]) self.assertGreater(second["counters"]["last_synced_duration"], 0) - self.assertEquals(second["counters"]["last_synced_bytes"], 10737418240) # last_synced_bytes = 10 files of 1024MB size each + self.assertEquals(second["counters"]["last_synced_bytes"], 1048576000) # last_synced_bytes = 10 files of 100MB size each # some more IO - for i in range(10): - self.mount_a.write_n_mb(os.path.join('d0', f'more_file.{i}'), 1024) + for i in range(15): + self.mount_a.write_n_mb(os.path.join('d0', f'more_file.{i}'), 100) time.sleep(60) # take another snapshot self.mount_a.run_shell(["mkdir", "d0/.snap/snap1"]) - time.sleep(500) + time.sleep(240) self.check_peer_status(self.primary_fs_name, self.primary_fs_id, "client.mirror_remote@ceph", '/d0', 'snap1', 2) self.verify_snapshot('d0', 'snap1') @@ -636,9 +636,9 @@ class TestMirroring(CephFSTestCase): third = res[TestMirroring.PERF_COUNTER_KEY_NAME_CEPHFS_MIRROR_PEER][0] self.assertGreater(third["counters"]["snaps_synced"], second["counters"]["snaps_synced"]) self.assertGreater(third["counters"]["last_synced_start"], second["counters"]["last_synced_end"]) - self.assertGreater(third["counters"]["last_synced_end"], third["counters"]["last_synced_start"]) + self.assertGreaterEqual(third["counters"]["last_synced_end"], third["counters"]["last_synced_start"]) self.assertGreater(third["counters"]["last_synced_duration"], 0) - self.assertEquals(third["counters"]["last_synced_bytes"], 10737418240) # last_synced_bytes = 10 files of 1024MB size each + self.assertEquals(third["counters"]["last_synced_bytes"], 1572864000) # last_synced_bytes = 15 files of 100MB size each # delete a snapshot self.mount_a.run_shell(["rmdir", "d0/.snap/snap0"])