fix: preserve batch receipts and resource recovery after review
Core regression / Python core, intervention UI and release configuration (push) Successful in 18m39s
Core regression / JavaScript syntax (push) Successful in 7s
Core regression / Python core, intervention UI and release configuration (pull_request) Successful in 11m51s
Core regression / JavaScript syntax (pull_request) Successful in 7s

This commit is contained in:
阿白叔 committed 2026-11-19 15:24:40 +08:00
1 parent e63a82b695
commit 4a438e027b
25 files changed
+748 -138

No files matched your search

+6 -4
View File
@@ -6,7 +6,7 @@ import pytest
from dx_productivity.trial_task_center import batch_resources, batch_runtime, isolated_desktop
def runtime_with_residual(tmp_path, monkeypatch):
def runtime_with_residual(tmp_path, monkeypatch, *, confirmation=False):
calls = []
class Desktop:
def __init__(self, name, **options):
@@ -18,7 +18,8 @@ def runtime_with_residual(tmp_path, monkeypatch):
calls.append('close')
self.cleanup_record = {'desktop_handle_closed': True,
'owned_cleanup_complete': True,
'desktop_confirmation': {'released': False}, 'errors': ['foreign reference']}
'desktop_confirmation': None if confirmation is None else {'released': confirmation},
'errors': ['foreign reference']}
raise OSError('foreign reference')
def release_desktop(self):
calls.append('observe')
@@ -30,8 +31,9 @@ def runtime_with_residual(tmp_path, monkeypatch):
return runtime, calls
def test_residual_desktop_is_warning_admits_fresh_batch_and_never_repeats_close(tmp_path, monkeypatch):
runtime, calls = runtime_with_residual(tmp_path, monkeypatch)
@pytest.mark.parametrize('confirmation', [False, None])
def test_residual_desktop_is_warning_admits_fresh_batch_and_never_repeats_close(tmp_path, monkeypatch, confirmation):
runtime, calls = runtime_with_residual(tmp_path, monkeypatch, confirmation=confirmation)
runtime.close()
assert runtime.record['state'] == 'isolated'
assert runtime.record['blocking'] is False