fix: isolate component failures and recover owned CAD resources

This commit is contained in:
阿白叔 committed 2026-11-06 14:56:53 +08:00
1 parent a8da30aad2
commit 4db5f05531
87 files changed
+6688 -301

No files matched your search

@@ -15,7 +15,7 @@ def frame(sequence, stage='capture', done=1, total=18, safe=1, token='token', jo
def test_progress_allows_total_runtime_to_exceed_idle_limit():
watch = worker_monitor.ProgressWatch('token', 'job', 150, 0)
for sequence, now in enumerate(range(100, 1001, 100), 1):
assert watch.accept(frame(sequence), now)
assert watch.accept(frame(sequence, done=sequence), now)
assert watch.action(now) is None
assert not watch.stop_requested
@@ -33,7 +33,7 @@ def test_progress_during_drain_prevents_emergency_kill():
watch = worker_monitor.ProgressWatch('token', 'job', 150, 0)
assert watch.action(150) == 'request_stop'
for sequence, now in enumerate((200, 350, 490, 630), 1):
assert watch.accept(frame(sequence, safe=0), now)
assert watch.accept(frame(sequence, done=sequence, safe=0), now)
assert watch.action(now) is None
assert watch.stop_requested
@@ -57,7 +57,7 @@ def test_replayed_sequence_does_not_extend_deadline():
def native_frame(sequence=1, *, parent=1, current='job', safe=1):
return f'DX_NATIVE_PROGRESS\ttoken\tjob\t{parent}\t{current}\t{sequence}\t1\t57\t{safe}\r\n'.encode()
return f'DX_NATIVE_PROGRESS\ttoken\tjob\t{parent}\t{current}\t{sequence}\t{sequence}\t57\t{safe}\r\n'.encode()
def test_native_progress_extends_only_its_live_read_without_changing_stdout_sequence():
@@ -67,7 +67,7 @@ def test_native_progress_extends_only_its_live_read_without_changing_stdout_sequ
assert watch.accept_native(native_frame(n), now)
assert watch.action(now) is None
assert watch.sequence == 1
assert watch.snapshot(now=301)['done'] == 1
assert watch.snapshot(now=301)['done'] == 3
assert watch.accept(frame(2, stage='verify'), 302)
assert not watch.accept_native(native_frame(4), 450)
assert watch.action(452) == 'request_stop'