fix: complete CLI admission and retire finished catalog journals

This commit is contained in:
阿白叔 committed 2026-11-23 18:48:48 +08:00
1 parent 8e0f78979a
commit f4f5e939eb
6 files changed
+271 -188

No files matched your search

+20
View File
@@ -181,3 +181,23 @@ def test_batch_cli_can_enable_verified_pcb_open(batch_cli, monkeypatch):
assert app.main(['--batch-lmc', 'lib.lmc', '--block', 'One']) == 0
assert app.main(['--batch-lmc', 'lib.lmc', '--block', 'One', '--auto-confirm-pcb-open']) == 0
assert received == [False, True]
def test_batch_cli_uses_bounded_session_admission(batch_cli, monkeypatch):
from cbb_refresh_verify.operation_queue import NativeQueue, QueueUnavailable
app, runner, _, _, _ = batch_cli
calls = []
def admit(self, action, **kwargs):
calls.append(kwargs)
raise QueueUnavailable(kwargs['context'].library, timed_out=True)
monkeypatch.setattr(NativeQueue, 'run', admit)
def run(requests, **kwargs):
assert kwargs['context'].library == str(requests[0].lmc_file)
with pytest.raises(QueueUnavailable):
kwargs['item_executor'](requests[0], lambda: pytest.fail('unexpected write'))
return [VerifyResult('SKIPPED') for _ in requests]
monkeypatch.setattr(runner, 'run_batch', run)
assert app.main(['--batch-lmc', 'lib.lmc', '--block', 'One', '--block', 'Two']) == 2
assert len(calls) == 1
assert calls[0]['wait_for_release_seconds'] == 120