fix: keep cold Cell reads outside native mutation deadline
This commit is contained in:
1 parent
4d1b825e4a
commit
ec75445f44
7 files changed
+179
-13
No files matched your search
@@ -36,9 +36,13 @@ def interrupted(tmp_path, monkeypatch):
|
||||
library.write_text('library fixture')
|
||||
catalog = SimpleNamespace(library_path=library, part_partition='library', part_number='NEW',
|
||||
cells=(SimpleNamespace(partition='RES', name='CELL'),), source_fingerprint='source-proof')
|
||||
catalog_reads = []
|
||||
def read_catalog(*args, **kwargs):
|
||||
catalog_reads.append(kwargs)
|
||||
return catalog
|
||||
monkeypatch.setitem(sys.modules, 'dx_productivity.trial_task_center.cell_catalog', SimpleNamespace(
|
||||
project_library_path=lambda project: library,
|
||||
read_library_cell_catalog=lambda *args, **kwargs: catalog))
|
||||
read_library_cell_catalog=read_catalog))
|
||||
project = tmp_path / 'project' / 'one.prj'
|
||||
project.parent.mkdir()
|
||||
project.write_text('project')
|
||||
@@ -62,7 +66,8 @@ def interrupted(tmp_path, monkeypatch):
|
||||
lock = handoff.command_path.parent / 'uncertain.flag'
|
||||
lock.write_text('old timeout')
|
||||
return SimpleNamespace(preparer=preparer, root=root, projects=projects, rules=rules, snapshot=snapshot,
|
||||
job=job, handoff=handoff, lock=lock, report=report, catalog=catalog, cell_proof=cell_proof)
|
||||
job=job, handoff=handoff, lock=lock, report=report, catalog=catalog, cell_proof=cell_proof,
|
||||
catalog_reads=catalog_reads)
|
||||
|
||||
|
||||
def invoke(fixture, **kwargs):
|
||||
@@ -313,3 +318,14 @@ def test_cell_catalog_drift_blocks_recovery_before_worker(interrupted,fault):
|
||||
assert calls==[]
|
||||
assert interrupted.lock.exists()
|
||||
assert interrupted.handoff.status_path.read_bytes()==before
|
||||
|
||||
|
||||
def test_standalone_recovery_allows_cold_catalog_preflight_before_worker(interrupted):
|
||||
interrupted.catalog_reads.clear()
|
||||
run_worker = worker_result(interrupted)
|
||||
def run(command, timeout):
|
||||
assert interrupted.catalog_reads == [{'allow_cold_read': True}]
|
||||
assert interrupted.lock.exists()
|
||||
return run_worker(command, timeout)
|
||||
interrupted.preparer._process_runner = run
|
||||
assert invoke(interrupted).state == 'restored_ok'
|
||||
Reference in new issue
Block a user