Skip to content

Commit

Permalink
Remove unneeded print
Browse files Browse the repository at this point in the history
  • Loading branch information
phvalguima committed Oct 4, 2024
1 parent 12181e1 commit 6d76daf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
23 changes: 18 additions & 5 deletions tests/integration/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,7 @@ def access_dashboard(
arguments = {"url": url, "headers": headers, "json": data}
if ssl:
arguments["verify"] = "./ca.pem"
try:
response = requests.post(**arguments)
except Exception:
print(response)
pass
response = requests.post(**arguments)
return response.status_code == 200


Expand Down Expand Up @@ -799,3 +795,20 @@ async def destroy_cluster(ops_test, app: str = OPENSEARCH_APP_NAME):
# This case we don't raise an error in the context manager which
# fails to restore the `update-status-hook-interval` value to it's former state.
assert n_apps_after == n_apps_before - 1, "old cluster not destroyed successfully."


async def for_machines(ops_test, machines, state="started"):
for attempt in Retrying(stop=stop_after_attempt(10), wait=wait_fixed(wait=60)):
with attempt:
for id in machines:
mach_status = json.loads(
subprocess.check_output(
["juju", "machines", f"--model={ops_test.model.name}", "--format=json"]
)
)["machines"]
if (
str(id) not in mach_status.keys()
or mach_status[str(id)]["juju-status"]["current"] != state
):
logger.warning(f"machine-{id} either not exist yet or not in {state}")
raise Exception()
18 changes: 1 addition & 17 deletions tests/integration/spaces/test_wrong_etc_hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
TLS_CERTIFICATES_APP_NAME,
access_all_dashboards,
access_all_prometheus_exporters,
for_machines,
get_relations,
)

Expand All @@ -27,23 +28,6 @@
DEFAULT_NUM_UNITS = 1


async def for_machines(ops_test, machines, state="started"):
for attempt in Retrying(stop=stop_after_attempt(10), wait=wait_fixed(wait=60)):
with attempt:
for id in machines:
mach_status = json.loads(
subprocess.check_output(
["juju", "machines", f"--model={ops_test.model.name}", "--format=json"]
)
)["machines"]
if (
str(id) not in mach_status.keys()
or mach_status[str(id)]["juju-status"]["current"] != state
):
logger.warning(f"machine-{id} either not exist yet or not in {state}")
raise Exception()


@pytest.mark.runner(["self-hosted", "linux", "X64", "jammy", "large"])
@pytest.mark.group(1)
@pytest.mark.abort_on_fail
Expand Down

0 comments on commit 6d76daf

Please sign in to comment.