fix: skip unavailable items and isolate batch failures

This commit is contained in:
阿白叔 committed 2026-11-19 10:06:04 +08:00
1 parent 07eab61695
commit 3bde847ff7
13 files changed
+592 -36

No files matched your search

+20
View File
@@ -122,6 +122,26 @@ def test_persistent_loading_progress_keeps_deadline_and_never_closes(diagnostic,
assert Session.instances[-1].posted == []
def test_cancel_from_window_scan_wins_expired_open_deadline(diagnostic, job, monkeypatch):
job['diagnostic_log_baseline'] = diagnostic.snapshot_diagnostic_logs(job)
write_logs(job)
signal = Path(job['root']).parent/'cancel-after-scan'
job['cancel_signal'] = str(signal)
clock = [0.0]
monkeypatch.setattr(diagnostic.time, 'monotonic', lambda: clock[0])
monkeypatch.setattr(diagnostic, '_NativeSession', Session)
target = frame(job)
target['children'].append({'hwnd':13,'class':'msctls_progress32','text':'','visible':True})
def windows(pid):
signal.touch()
clock[0] = 10.0
return [target]
monkeypatch.setattr(diagnostic, '_windows', windows)
with pytest.raises(RuntimeError, match='VERIFY_CANCELLED'):
diagnostic.check_target_window(job, 42, emit=lambda **event: None, error_reader=lambda: None)
assert Session.instances[-1].posted == []
def test_diagnostic_waits_for_startup_forward_no_before_close(diagnostic, job, monkeypatch):
job['diagnostic_log_baseline'] = diagnostic.snapshot_diagnostic_logs(job)
write_logs(job); job['timeout'] = 1