Fix flaky recorder migration tests (#123971)
parent
5836f8edb5
commit
81c4bb5f72
|
@ -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(),
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue