diff --git a/tests/components/recorder/conftest.py b/tests/components/recorder/conftest.py index d66cf4fe2ec..b13b3b270a9 100644 --- a/tests/components/recorder/conftest.py +++ b/tests/components/recorder/conftest.py @@ -68,7 +68,7 @@ class InstrumentedMigration: non_live_migration_done: threading.Event non_live_migration_done_stall: threading.Event apply_update_mock: Mock - stall_on_schema_version: int + stall_on_schema_version: int | None apply_update_stalled: threading.Event @@ -147,7 +147,8 @@ def instrument_migration( old_version: int, ): """Control migration progress.""" - if new_version == instrumented_migration.stall_on_schema_version: + stall_version = instrumented_migration.stall_on_schema_version + if stall_version is None or stall_version == new_version: instrumented_migration.apply_update_stalled.set() instrumented_migration.migration_stall.wait() real_apply_update( @@ -179,7 +180,7 @@ def instrument_migration( non_live_migration_done=threading.Event(), non_live_migration_done_stall=threading.Event(), apply_update_mock=apply_update_mock, - stall_on_schema_version=1, + stall_on_schema_version=None, apply_update_stalled=threading.Event(), )