fix: preserve a queued retry while an identified Mentor save runs
This commit is contained in:
1 parent
6aed02d26b
commit
2722d09b59
3 files changed
+32
-3
No files matched your search
@@ -27,3 +27,22 @@ def test_batch_admission_reports_resource_at_entry(tmp_path, monkeypatch):
|
||||
monkeypatch.setattr('cbb_refresh_verify.library_lock.recheck_previous_release', busy)
|
||||
with pytest.raises(QueueUnavailable, match='共享符号库 icdb.dat 仍在使用'):
|
||||
verify_runner.wait_for_batch_release(request, BatchTaskContext(str(library)), timeout_seconds=0)
|
||||
|
||||
|
||||
|
||||
def test_batch_waits_for_recorded_save_past_ordinary_release_deadline(tmp_path, monkeypatch):
|
||||
from cbb_refresh_verify import verify_runner
|
||||
from cbb_refresh_verify import session_record
|
||||
library = tmp_path/'library.lmc'
|
||||
library.touch()
|
||||
request = VerifyRequest(library, 'Next', tmp_path/'evidence')
|
||||
context = BatchTaskContext(str(library))
|
||||
waiting = []
|
||||
monkeypatch.setattr(session_record, 'library_available', lambda *a, **k: bool(waiting))
|
||||
monkeypatch.setattr(session_record, 'retained_session_states', lambda *_: [
|
||||
{'status': 'ACTIVE', 'phase': 'NATIVE_CALL', 'block': 'Previous',
|
||||
'active_save': True}])
|
||||
monkeypatch.setattr('cbb_refresh_verify.library_lock.recheck_previous_release', lambda *a, **k: None)
|
||||
monkeypatch.setattr(context.stop, 'wait', lambda interval: waiting.append(interval))
|
||||
verify_runner.wait_for_batch_release(request, context, timeout_seconds=0)
|
||||
assert len(waiting) == 1
|
||||
Reference in new issue
Block a user