Skip to content

Commit

Permalink
fix up
Browse files Browse the repository at this point in the history
Signed-off-by: Mahesh Shetty <[email protected]>
  • Loading branch information
mashetty330 committed Sep 21, 2023
1 parent 67cd511 commit eef33b6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion ocs_ci/ocs/bucket_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1765,7 +1765,9 @@ def remove_replication_policy(bucket_name):
bucket_name(str): Name of the bucket
"""
replication_policy_patch_dict = {"spec": {"additionalConfig": {}}}
replication_policy_patch_dict = {
"spec": {"additionalConfig": {{"replicationPolicy": ""}}}
}

OCP(
kind="obc",
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6805,6 +6805,7 @@ def reduce_replication_delay_setup(add_env_vars_to_noobaa_core_class):
new_delay_in_miliseconds (function): A function to add env vars to the noobaa-core pod
"""
log.warning("Reducing replication delay")

def factory(new_delay_in_miliseconds=60 * 1000):
new_env_var_tuples = [
Expand Down
10 changes: 7 additions & 3 deletions tests/e2e/system_test/test_mcg_replication_with_disruptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def test_log_based_replication_with_disruptions(
"""

mockup_logger, source_bucket, target_bucket = log_based_replication_setup
mockup_logger, source_bucket, target_bucket = log_based_replication_setup()

# upload test objects to the bucket and verify replication
upload_test_objects_to_source_and_wait_for_replication(
Expand All @@ -287,17 +287,21 @@ def test_log_based_replication_with_disruptions(
objs_in_bucket = mockup_logger.standard_test_obj_list
objs_to_delete = random.sample(objs_in_bucket, 3)

from ocs_ci.utility.retry import retry

@retry(Exception, tries=10, delay=5)
def delete_objs_in_batch():
for obj in objs_to_delete:
mockup_logger.delete_objs_and_log(source_bucket.name, [obj])
time.sleep(5)
logger.info(f"Successfully deleted these objects: {objs_to_delete}")

with ThreadPoolExecutor(max_workers=1) as executor:
future = executor.submit(delete_objs_in_batch)

# Restart noobaa pods
nb_core_pod = get_noobaa_core_pod
nb_db_pod = get_noobaa_db_pod
nb_core_pod = get_noobaa_core_pod()
nb_db_pod = get_noobaa_db_pod()
nb_core_pod.delete()
nb_db_pod.delete()
wait_for_pods_to_be_running(pod_names=[nb_core_pod.name, nb_db_pod.name])
Expand Down

0 comments on commit eef33b6

Please sign in to comment.