]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/test: allow for duplicate events in pubsub 39461/head
authorYuval Lifshitz <ylifshit@redhat.com>
Sun, 14 Feb 2021 15:19:17 +0000 (17:19 +0200)
committerYuval Lifshitz <ylifshit@redhat.com>
Sun, 14 Feb 2021 15:22:50 +0000 (17:22 +0200)
when tested via radosgw-admin.
also, add verification for the content of the events

Fixes: https://tracker.ceph.com/issues/49261
Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
src/test/rgw/rgw_multi/tests_ps.py

index 0749292f8d5dc4366ee06edc66dde1603abaeb9e..5fac1cdfb81de3887299c00c83660a372d99a050 100644 (file)
@@ -3053,17 +3053,19 @@ def test_ps_admin():
             + ps_zone.zone.zone_arg())
     assert_equal(status, 0)
     parsed_result = json.loads(result)
-    assert_equal(len(parsed_result['events']), 100)
     marker = parsed_result['next_marker']
+    events1 = parsed_result['events']
     result, status = ps_zone.zone.cluster.admin(['subscription', 'pull', '--uid', get_user(), '--subscription', bucket_name+SUB_SUFFIX, '--marker', marker]
             + ps_zone.zone.zone_arg())
     assert_equal(status, 0)
     parsed_result = json.loads(result)
-    assert_equal(len(parsed_result['events']), 10)
-    event_id = parsed_result['events'][0]['id']
+    events2 = parsed_result['events'] 
+    
+    keys = list(bucket.list())
+    verify_events_by_elements({"events": events1+events2}, keys, exact_match=False)
 
     # ack an event in the subscription 
-    result, status = ps_zone.zone.cluster.admin(['subscription', 'ack', '--uid', get_user(), '--subscription', bucket_name+SUB_SUFFIX, '--event-id', event_id]
+    result, status = ps_zone.zone.cluster.admin(['subscription', 'ack', '--uid', get_user(), '--subscription', bucket_name+SUB_SUFFIX, '--event-id', events2[0]['id']]
             + ps_zone.zone.zone_arg())
     assert_equal(status, 0)