feat: integrate native diagnostics and coordinated CBB transactions

This commit is contained in:
阿白叔 committed 2026-11-05 23:18:00 +08:00
1 parent 9e230e1a46
commit da67de026f
91 files changed
+14370 -435

No files matched your search

+11 -11
View File
@@ -200,14 +200,14 @@ def test_worker_attempts_normal_close_after_idle_integration_failure(tmp_path, m
assert not any(event['stage'] == 'save_start' for event in events)
def test_stop_requests_cooperative_cancel_without_terminating_busy_client(tmp_path):
def test_stop_cancels_then_stops_automation_client_after_deadline(tmp_path):
calls = []
class BusyWorker:
def request_stop(self): calls.append('cancel')
def wait(self, timeout): raise TimeoutError('native Save still running')
def kill(self): calls.append('kill')
runner._stop_worker(BusyWorker(), timeout=0)
assert calls == ['cancel']
assert calls == ['cancel', 'kill']
def test_status_server_close_allows_eof_cleanup_before_termination(tmp_path):
@@ -225,21 +225,22 @@ def test_status_server_close_allows_eof_cleanup_before_termination(tmp_path):
assert marker.is_file()
def test_shared_symbol_database_owner_blocks_content_check_and_pcb(tmp_path, monkeypatch):
def test_shared_address_does_not_block_actual_content_check(tmp_path, monkeypatch):
from test_verify_runner import fixture, request
fixture(tmp_path)
address = tmp_path/'SymbolLibs/__ReusableBlocksSymb/cdbsvr/sAddress.adr'
address.parent.mkdir(parents=True)
address.write_bytes(b'unknown native owner')
req = request(tmp_path, libspec='EE', dms_login_config='login')
outcome = runner.run_verify(req, process_runner=lambda *args: pytest.fail('must not launch importer'))
assert outcome.status == 'BLOCKED'
assert outcome.safe_to_continue is False
assert '__ReusableBlocksSymb' in outcome.stderr
calls = []
outcome = runner.run_verify(req, process_runner=lambda *args:
(calls.append(args) or (1, 'ERROR: shared database unavailable', '', False)))
assert calls and outcome.status == 'FAIL' and outcome.safe_to_continue
assert 'shared database unavailable' in outcome.stderr
assert address.read_bytes() == b'unknown native owner'
def test_shared_symbol_database_must_be_released_before_pass(tmp_path, monkeypatch):
def test_shared_address_is_diagnostic_after_successful_native_execution(tmp_path, monkeypatch):
from test_verify_worker_stability import exercise_worker
from cbb_refresh_verify import mentor_adapter as adapter
job, events, execute = exercise_worker(tmp_path, monkeypatch)
@@ -250,9 +251,8 @@ def test_shared_symbol_database_must_be_released_before_pass(tmp_path, monkeypat
address.write_bytes(b'shared owner retained')
return original(*args, **kwargs)
monkeypatch.setattr(adapter.subprocess, 'Popen', helper)
with pytest.raises(RuntimeError, match='ICDB_RELEASE_UNCONFIRMED'):
execute()
assert not any(event['stage'] == 'complete' for event in events)
assert execute()['status'] == 'PASS'
assert any(event['stage'] == 'icdb_address_remaining' for event in events)
def test_cooperative_supervisor_loss_keeps_pending_save_helper_alive(tmp_path):