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

[DPE-3181] fix flakey backup tets #329

Merged
merged 1 commit into from
Jan 9, 2024
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
21 changes: 12 additions & 9 deletions tests/integration/backup_tests/test_backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ async def test_blocked_incorrect_creds(ops_test: OpsTest) -> None:
)

# verify that Charmed MongoDB is blocked and reports incorrect credentials
await asyncio.gather(
ops_test.model.wait_for_idle(apps=[S3_APP_NAME], status="active"),
ops_test.model.wait_for_idle(apps=[db_app_name], status="blocked", idle_period=20),
)
db_unit = ops_test.model.applications[db_app_name].units[0]
async with ops_test.fast_forward():
await asyncio.gather(
ops_test.model.wait_for_idle(apps=[S3_APP_NAME], status="active"),
ops_test.model.wait_for_idle(apps=[db_app_name], status="blocked", idle_period=20),
)
db_unit = ops_test.model.applications[db_app_name].units[0]

assert db_unit.workload_status_message == "s3 credentials are incorrect."

Expand All @@ -91,10 +92,12 @@ async def test_blocked_incorrect_conf(ops_test: OpsTest) -> None:
await helpers.set_credentials(ops_test, cloud="AWS")

# wait for both applications to be idle with the correct statuses
await asyncio.gather(
ops_test.model.wait_for_idle(apps=[S3_APP_NAME], status="active"),
ops_test.model.wait_for_idle(apps=[db_app_name], status="blocked", idle_period=20),
)
async with ops_test.fast_forward():
await asyncio.gather(
ops_test.model.wait_for_idle(apps=[S3_APP_NAME], status="active"),
ops_test.model.wait_for_idle(apps=[db_app_name], status="blocked", idle_period=20),
)

db_unit = ops_test.model.applications[db_app_name].units[0]
assert db_unit.workload_status_message == "s3 configurations are incompatible."

Expand Down
Loading