Skip to content

Commit 2f4d153

Browse files
authored
Fix test failure: test_migrate_external_table_failed_sync (#2869)
## Changes Test looked to be fixed already ### Linked issues Resolves #2779 ### Tests - [x] modified integration tests: `test_migrate_external_table_failed_sync`
1 parent 7f5e562 commit 2f4d153

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/integration/hive_metastore/test_migrate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,10 @@ def test_migrate_external_table(
171171

172172

173173
@retried(on=[NotFound], timeout=timedelta(minutes=1))
174-
def test_migrate_external_table_failed_sync(ws, caplog, runtime_ctx, env_or_skip):
174+
def test_migrate_external_table_failed_sync(caplog, runtime_ctx, env_or_skip) -> None:
175175
src_schema = runtime_ctx.make_schema(catalog_name="hive_metastore")
176176
existing_mounted_location = f'dbfs:/mnt/{env_or_skip("TEST_MOUNT_NAME")}/a/b/c'
177177
src_external_table = runtime_ctx.make_table(schema_name=src_schema.name, external_csv=existing_mounted_location)
178-
179178
# create a mapping that will fail the SYNC because the target catalog and schema does not exist
180179
rules = [
181180
Rule(
@@ -189,8 +188,9 @@ def test_migrate_external_table_failed_sync(ws, caplog, runtime_ctx, env_or_skip
189188
]
190189
runtime_ctx.with_table_mapping_rules(rules)
191190
runtime_ctx.with_dummy_resource_permission()
192-
runtime_ctx.tables_migrator.migrate_tables(what=What.EXTERNAL_SYNC)
193191

192+
with caplog.at_level(logging.WARNING, logger="databricks.labs.ucx.hive_metastore.table_migrate"):
193+
runtime_ctx.tables_migrator.migrate_tables(what=What.EXTERNAL_SYNC)
194194
assert "SYNC command failed to migrate" in caplog.text
195195

196196

0 commit comments

Comments
 (0)