fix: enforce native repair ownership and cancellation boundaries

This commit is contained in:
阿白叔 committed 2026-10-27 18:08:14 +08:00
1 parent 2490067b2d
commit 9cd4968a97
8 files changed
+248 -10

No files matched your search

+15
View File
@@ -289,3 +289,18 @@ def test_cooperative_supervisor_loss_keeps_pending_save_helper_alive(tmp_path):
if handle:
win32process.TerminateProcess(handle, 0)
handle.Close()
def test_idle_failed_native_verify_closes_its_library_manager_owner(tmp_path, monkeypatch):
from types import SimpleNamespace
from test_verify_worker_stability import exercise_worker
job, events, execute = exercise_worker(tmp_path, monkeypatch, integration_error='packaging rejected')
job['native_lm_verify'] = True
closed = []
monkeypatch.setattr('cbb_refresh_verify.library_manager_verify.launch_library_verify',
lambda *a, **kw: SimpleNamespace(process=SimpleNamespace(pid=11), close=lambda: closed.append(11)))
monkeypatch.setattr('cbb_refresh_verify.failed_session.close_failed_document',
lambda *a, **kw: {'status':'CLOSED'})
with pytest.raises(RuntimeError, match='packaging rejected'):
execute()
assert closed == [11]