Skip to content

Commit

Permalink
[MISC] Adds missing await to invalid_extra_user_roles integration…
Browse files Browse the repository at this point in the history
… test + fix check loop (#602)

* add awaits to block until calls

* fix loop check
  • Loading branch information
lucasgameiroborges authored Aug 1, 2024
1 parent 383a809 commit e121441
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/relations/postgresql_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def check_for_invalid_extra_user_roles(self, relation_id: int) -> bool:
for data in relation.data.values():
extra_user_roles = data.get("extra-user-roles")
if extra_user_roles is None:
break
continue
extra_user_roles = extra_user_roles.lower().split(",")
for extra_user_role in extra_user_roles:
if (
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/new_relations/test_new_relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ async def test_invalid_extra_user_roles(ops_test: OpsTest):
for app in data_integrator_apps_names:
await ops_test.model.add_relation(f"{app}:postgresql", f"{DATABASE_APP_NAME}:database")
await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME])
ops_test.model.block_until(
await ops_test.model.block_until(
lambda: any(
unit.workload_status_message == INVALID_EXTRA_USER_ROLE_BLOCKING_MESSAGE
for unit in ops_test.model.applications[DATABASE_APP_NAME].units
Expand All @@ -566,7 +566,7 @@ async def test_invalid_extra_user_roles(ops_test: OpsTest):
f"{DATABASE_APP_NAME}:database", f"{DATA_INTEGRATOR_APP_NAME}:postgresql"
)
await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME])
ops_test.model.block_until(
await ops_test.model.block_until(
lambda: any(
unit.workload_status_message == INVALID_EXTRA_USER_ROLE_BLOCKING_MESSAGE
for unit in ops_test.model.applications[DATABASE_APP_NAME].units
Expand Down

0 comments on commit e121441

Please sign in to comment.