fix: observe retained sessions without blocking independent libraries

This commit is contained in:
阿白叔 committed 2026-11-06 15:42:40 +08:00
1 parent 6278091f21
commit cb11624b68
9 files changed
+134 -7

No files matched your search

+16
View File
@@ -1,6 +1,22 @@
from pathlib import Path
def test_cli_signal_requests_cooperative_batch_stop(tmp_path, monkeypatch):
import signal
from cbb_refresh_verify import application, verify_runner
library = tmp_path/'center.lmc'
library.touch()
old = signal.getsignal(signal.SIGINT)
def run(requests, *, stop):
signal.getsignal(signal.SIGINT)(signal.SIGINT, None)
assert stop.is_set()
return [verify_runner.VerifyResult('CANCELLED')]
monkeypatch.setattr(verify_runner, 'run_batch', run)
assert application.main(['--batch-lmc', str(library), '--block', 'A',
'--data-root', str(tmp_path/'data')]) == 2
assert signal.getsignal(signal.SIGINT) is old
def test_smoke_arguments_exit_zero_and_write_lifecycle_log(tmp_path: Path):
import subprocess, sys
result = subprocess.run([sys.executable, '-m', 'cbb_refresh_verify', '--smoke-test', '--data-root', str(tmp_path)], timeout=30)