Skip to content

Commit

Permalink
Fix memory leak in Get bucket replication test
Browse files Browse the repository at this point in the history
Fixes: #11218

Signed-off-by: Petr Balogh <[email protected]>
  • Loading branch information
petr-balogh committed Jan 23, 2025
1 parent c3155fd commit cd5d9ca
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions tests/functional/object/mcg/test_bucket_replication.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import gc

import pytest

Expand Down Expand Up @@ -492,11 +493,14 @@ def test_unidirectional_bucketclass_replication(

def check_nb_endpoint_logs():
for pod in get_noobaa_endpoint_pods():
pod_logs = get_pod_logs(pod.name)
if (
"The AWS access key Id you provided does not exist in our records"
in get_pod_logs(pod.name)
in pod_logs
):
return True
del pod_logs
gc.collect()
return False

sample = TimeoutSampler(timeout=360, sleep=10, func=check_nb_endpoint_logs)
Expand All @@ -521,12 +525,13 @@ def check_nb_endpoint_logs():

# check in noobaa core logs
def check_noobaa_core_logs():
if "find_rules_updated_longest_time_ago: []" in get_pod_logs(
get_noobaa_core_pod().name
):
return True
else:
return False
found = False
pod_logs = get_pod_logs(get_noobaa_core_pod().name)
if "find_rules_updated_longest_time_ago: []" in pod_logs:
found = True
del pod_logs
gc.collect()
return found

logger.info(
f"Checking the noobaa core logs to see if the replication has "
Expand Down

0 comments on commit cd5d9ca

Please sign in to comment.