Skip to content

Commit 76360fc

Browse files
authored
Fix failing integration test test_reflect_account_groups_on_workspace_skips_groups_that_already_exists_in_the_workspace (#2615)
## Changes Fix failing integration test `test_reflect_account_groups_on_workspace_skips_groups_that_already_exists_in_the_workspace` by waiting for the groups used for testing to be provisioned (instead of in the process of being provisioned). ### Linked issues Resolves #2559 ### Tests - [ ] modified integration tests `test_reflect_account_groups_on_workspace_skips_groups_that_already_exists_in_the_workspace`
1 parent de70112 commit 76360fc

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

tests/integration/workspace_access/test_groups.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,20 @@ def test_rename_groups(ws, make_ucx_group, sql_backend, inventory_schema):
6060

6161

6262
@retried(on=[NotFound], timeout=timedelta(minutes=2))
63-
def test_reflect_account_groups_on_workspace_recovers_when_group_already_exists(
64-
ws, make_ucx_group, sql_backend, inventory_schema
63+
def test_reflect_account_groups_on_workspace_skips_groups_that_already_exists_in_the_workspace(
64+
caplog,
65+
ws,
66+
make_ucx_group,
67+
sql_backend,
68+
inventory_schema,
6569
):
66-
ws_group, _ = make_ucx_group()
70+
"""The groups that already are reflected in the workspace should be skipped."""
71+
ws_group, acc_group = make_ucx_group(wait_for_provisioning=True)
6772

6873
group_manager = GroupManager(sql_backend, ws, inventory_schema, [ws_group.display_name], "ucx-temp-")
69-
group_manager.reflect_account_groups_on_workspace()
74+
with caplog.at_level(logging.INFO, logger="databricks.labs.ucx.workspace_access.groups"):
75+
group_manager.reflect_account_groups_on_workspace()
76+
assert f"Skipping {acc_group.display_name}: already in workspace" in caplog.text
7077

7178

7279
@retried(on=[NotFound], timeout=timedelta(minutes=2))

0 commit comments

Comments
 (0)