Skip to content

Commit

Permalink
Fix test: test_ceph_manager_stopped (red-hat-storage#10428)
Browse files Browse the repository at this point in the history
Signed-off-by: Akarsha-rai <akrai@redhat.com>
  • Loading branch information
Akarsha-rai committed Sep 10, 2024
1 parent 88de3ec commit 07a2ca1
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/functional/monitoring/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def measure_stop_ceph_mgr(measurement_dir, threading_lock):
threading_lock=threading_lock,
)
mgr_deployments = oc.get(selector=constants.MGR_APP_LABEL)["items"]
mgr = mgr_deployments[0]["metadata"]["name"]

def stop_mgr():
"""
Expand All @@ -67,12 +66,14 @@ def stop_mgr():
# run_time of operation
run_time = 60 * 7
nonlocal oc
nonlocal mgr
logger.info(f"Downscaling deployment {mgr} to 0")
oc.exec_oc_cmd(f"scale --replicas=0 deployment/{mgr}")
nonlocal mgr_deployments
for mgr_deployment in mgr_deployments:
mgr = mgr_deployment["metadata"]["name"]
logger.info(f"Downscaling deployment {mgr} to 0")
oc.exec_oc_cmd(f"scale --replicas=0 deployment/{mgr}")
logger.info(f"Waiting for {run_time} seconds")
time.sleep(run_time)
return oc.get(mgr)
return mgr_deployments

test_file = os.path.join(measurement_dir, "measure_stop_ceph_mgr.json")
if config.ENV_DATA["platform"].lower() in constants.MANAGED_SERVICE_PLATFORMS:
Expand All @@ -89,9 +90,10 @@ def stop_mgr():
measured_op = measure_operation(
stop_mgr, test_file, threading_lock=threading_lock
)
logger.info(f"Upscaling deployment {mgr} back to 1")
oc.exec_oc_cmd(f"scale --replicas=1 deployment/{mgr}")

for mgr_deployment in mgr_deployments:
mgr = mgr_deployment["metadata"]["name"]
logger.info(f"Upscaling deployment {mgr} back to 1")
oc.exec_oc_cmd(f"scale --replicas=1 deployment/{mgr}")
# wait for ceph to return into HEALTH_OK state after mgr deployment
# is returned back to normal
ceph_health_check(tries=20, delay=15)
Expand Down

0 comments on commit 07a2ca1

Please sign in to comment.