]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
RGW|BN: fix lifecycle test and http server issue 59010/head
authorAli Masarwa <amasarwa@redhat.com>
Thu, 18 Jul 2024 12:24:05 +0000 (15:24 +0300)
committerAli Masarwa <amasarwa@redhat.com>
Sun, 4 Aug 2024 08:05:41 +0000 (11:05 +0300)
Signed-off-by: Ali Masarwa <amasarwa@redhat.com>
(cherry picked from commit cb421a466365e8dff6c2b80fc9e6b2ec5c3aa111)

src/test/rgw/bucket_notification/test_bn.py

index 415cb9947938955480c9106ebc1190d7efb73861..2d11c0f469887019bab7d19d99d8b358357aab56 100644 (file)
@@ -1939,10 +1939,16 @@ def test_ps_s3_lifecycle_on_master():
 
     # start lifecycle processing
     admin(['lc', 'process'], get_config_cluster())
-    print('wait for 20s for the lifecycle...')
-    time.sleep(20)
-
+    print('polling on bucket object to check if lifecycle deleted them...')
+    max_loops = 100
     no_keys = list(bucket.list())
+    while len(no_keys) > 0 and max_loops > 0:
+        print('waiting 5 secs to check if lifecycle kicked in')
+        time.sleep(5)
+        no_keys = list(bucket.list())
+        max_loops = max_loops - 1
+
+    assert len(no_keys) == 0, "lifecycle didn't delete the objects after 500 seconds"
     wait_for_queue_to_drain(topic_name)
     assert_equal(len(no_keys), 0)
     event_keys = []