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

[MISC] Await config change #543

Merged
merged 2 commits into from
Feb 19, 2025
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
10 changes: 6 additions & 4 deletions tests/integration/test_upgrade_data_integrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import pytest
from pytest_operator.plugin import OpsTest
from tenacity import Retrying, stop_after_delay, wait_fixed

from constants import BACKEND_RELATION_NAME

Expand Down Expand Up @@ -60,7 +61,7 @@ async def test_deploy_stable(ops_test: OpsTest, charm) -> None:
pgb_application = ops_test.model.applications[PGB]
pgb_configs = await pgb_application.get_config()
if "expose-external" in pgb_configs:
pgb_application.set_config({"expose-external": "nodeport"})
await pgb_application.set_config({"expose-external": "nodeport"})

logger.info("Wait for applications to become active")

Expand Down Expand Up @@ -95,7 +96,9 @@ async def test_upgrade_from_stable(ops_test: OpsTest, charm):
credentials = await fetch_action_get_credentials(
ops_test.model.applications[DATA_INTEGRATOR_APP_NAME].units[0]
)
check_exposed_connection(credentials, False)
for attempt in Retrying(stop=stop_after_delay(30), wait=wait_fixed(3), reraise=True):
with attempt:
Comment on lines +99 to +100
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check_exposed_connection(credentials, False)
global initial_credentials
initial_credentials = credentials

Expand Down Expand Up @@ -144,5 +147,4 @@ async def test_upgrade_from_stable(ops_test: OpsTest, charm):
)
check_exposed_connection(credentials, False)

# TODO Enable when we habe persistent service
# assert credentials["postgresql"]["endpoints"] == initial_credentials["postgresql"]["endpoints"]
assert credentials["postgresql"]["endpoints"] == initial_credentials["postgresql"]["endpoints"]