From ca32f0dab822b6feac86126a4f73d7f64e879052 Mon Sep 17 00:00:00 2001 From: Jos Collin Date: Tue, 6 May 2025 17:20:39 +0530 Subject: [PATCH] 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 (cherry picked from commit 9738b8d36275fda42d847058aab55ba1e6e6e7fc) --- qa/tasks/cephfs/test_mirroring.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/qa/tasks/cephfs/test_mirroring.py b/qa/tasks/cephfs/test_mirroring.py index 062f67419cde6..619d719e9d7d1 100644 --- a/qa/tasks/cephfs/test_mirroring.py +++ b/qa/tasks/cephfs/test_mirroring.py @@ -561,7 +561,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) @@ -575,7 +575,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') @@ -585,20 +585,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') @@ -608,9 +608,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"]) -- 2.39.5