Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-4.16] Fix test: test_ceph_manager_stopped #10500

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading