1212from databricks .labs .blueprint .parallel import Threads
1313from databricks .labs .blueprint .tui import MockPrompts
1414from databricks .labs .blueprint .wheels import WheelsV2
15- from databricks .sdk .errors import InvalidParameterValue , NotFound , Unknown
15+ from databricks .sdk .errors import InvalidParameterValue , NotFound
1616from databricks .sdk .retries import retried
1717from databricks .sdk .service import compute , sql
1818from databricks .sdk .service .iam import PermissionLevel
3636
3737
3838@pytest .fixture
39- def new_installation (ws , sql_backend , env_or_skip , inventory_schema , make_random , make_cluster_policy ):
39+ def new_installation (ws , sql_backend , env_or_skip , inventory_schema , make_random ):
4040 cleanup = []
4141
4242 def factory (config_transform : Callable [[WorkspaceConfig ], WorkspaceConfig ] | None = None ):
@@ -98,7 +98,7 @@ def factory(config_transform: Callable[[WorkspaceConfig], WorkspaceConfig] | Non
9898 pending .uninstall ()
9999
100100
101- @retried (on = [NotFound , Unknown , TimeoutError ], timeout = timedelta (minutes = 5 ))
101+ @retried (on = [NotFound , TimeoutError ], timeout = timedelta (minutes = 5 ))
102102def test_job_failure_propagates_correct_error_message_and_logs (ws , sql_backend , new_installation ):
103103 install = new_installation ()
104104
@@ -113,7 +113,7 @@ def test_job_failure_propagates_correct_error_message_and_logs(ws, sql_backend,
113113 assert len (workflow_run_logs ) == 1
114114
115115
116- @retried (on = [NotFound , Unknown , InvalidParameterValue ], timeout = timedelta (minutes = 3 ))
116+ @retried (on = [NotFound , InvalidParameterValue ], timeout = timedelta (minutes = 3 ))
117117def test_job_cluster_policy (ws , new_installation ):
118118 install = new_installation (lambda wc : replace (wc , override_clusters = None ))
119119 user_name = ws .current_user .me ().user_name
@@ -154,7 +154,7 @@ def test_new_job_cluster_with_policy_assessment(
154154 assert before [ws_group_a .display_name ] == PermissionLevel .CAN_USE
155155
156156
157- @retried (on = [NotFound , Unknown , InvalidParameterValue ], timeout = timedelta (minutes = 10 ))
157+ @retried (on = [NotFound , InvalidParameterValue ], timeout = timedelta (minutes = 10 ))
158158def test_running_real_assessment_job (
159159 ws , new_installation , make_ucx_group , make_cluster_policy , make_cluster_policy_permissions
160160):
@@ -175,7 +175,7 @@ def test_running_real_assessment_job(
175175 assert before [ws_group_a .display_name ] == PermissionLevel .CAN_USE
176176
177177
178- @retried (on = [NotFound , Unknown , InvalidParameterValue ], timeout = timedelta (minutes = 5 ))
178+ @retried (on = [NotFound , InvalidParameterValue ], timeout = timedelta (minutes = 5 ))
179179def test_running_real_migrate_groups_job (
180180 ws , sql_backend , new_installation , make_ucx_group , make_cluster_policy , make_cluster_policy_permissions
181181):
@@ -208,7 +208,7 @@ def test_running_real_migrate_groups_job(
208208 assert found [f"{ install .config .renamed_group_prefix } { ws_group_a .display_name } " ] == PermissionLevel .CAN_USE
209209
210210
211- @retried (on = [NotFound , Unknown , InvalidParameterValue ], timeout = timedelta (minutes = 5 ))
211+ @retried (on = [NotFound , InvalidParameterValue ], timeout = timedelta (minutes = 5 ))
212212def test_running_real_validate_groups_permissions_job (
213213 ws , sql_backend , new_installation , make_group , make_query , make_query_permissions
214214):
@@ -264,7 +264,7 @@ def test_running_real_validate_groups_permissions_job_fails(
264264 request_object_type = "cluster-policies" , request_object_id = cluster_policy .policy_id , access_control_list = []
265265 )
266266
267- with pytest .raises (Unknown , match = r"Detected \d+ failures: ValueError" ):
267+ with pytest .raises (ValueError ):
268268 install .run_workflow ("validate-groups-permissions" )
269269
270270
0 commit comments