fix: address PR 47 batch execution and resource audit
Core regression / Python core, intervention UI and release configuration (push) Failing after 7m8s
Core regression / JavaScript syntax (push) Successful in 8s
Core regression / Python core, intervention UI and release configuration (pull_request) Failing after 7m12s
Core regression / JavaScript syntax (pull_request) Successful in 8s

This commit is contained in:
阿白叔 committed 2026-11-27 17:25:44 +08:00
1 parent 392ae365da
commit 2a89d6fdd4
29 files changed
+1449 -298

No files matched your search

+16 -4
View File
@@ -120,6 +120,10 @@ def test_inspect_restores_a_determined_resource_pause_only_from_its_original_bat
batch_resources.write_record(directory / 'supervisor.json', dict(binding,
operation='execute_task_queue', task_ids=ids, state='finished', process=identity,
parent_process=identity, request_sha256=request_digest))
batch_resources.write_record(directory / 'session.json', dict(version=1, session_id=batch_id,
kind='task_queue', generation=1, desktop='dx-' + batch_id, state='released', processes=[],
cad_pid=None, cad_guid=None, checkpoints={}, retries={}, timings=[], release_proof={
'generation': 1, 'desktop_released': True, 'processes_exited': True}))
paused = TaskQueueResult(token, tuple(TaskQueueEntry(item, row['state'])
for item, row in state['entries'].items()), True, ids[0])
batch_resources.write_record(directory / 'result.json', dict(binding, generation=1, sequence=1, type='result',
@@ -166,7 +170,7 @@ def test_shared_safe_primary_failure_can_hold_remaining_commands_on_resume(proje
@pytest.mark.parametrize('isolated', [True, False])
def test_released_isolated_project_does_not_block_resume_of_other_projects(project_service, isolated):
def test_released_projects_require_a_verified_result_to_resume_other_projects(project_service, isolated):
from dx_productivity.dsh.run_journal import resume_preflight
service, _, data, ids, hashes = project_service
journal = RunJournal(data)
@@ -181,13 +185,21 @@ def test_released_isolated_project_does_not_block_resume_of_other_projects(proje
path.write_text(json.dumps({'version': 1, 'task_ids': ids, 'plan_hashes': hashes,
'phase': 'primary' if isolated else 'problems', 'entries': entries}))
result = journal.inspect(service, 'd' * 32)
assert result['queue_available'] and result['resume_ready'], result['blockers']
assert result['queue_available']
assert result['remaining_task_ids'] == (ids[1:] if isolated else ids)
assert result['isolated_task_ids'] == ([ids[0]] if isolated else [])
assert result['tasks'][0]['interrupted'] == isolated
assert result['tasks'][0]['interrupted'] is isolated
if isolated:
assert not result['resume_ready'] and 'interrupted' in result['blockers']
assert not result['cad_execution_started']
with pytest.raises(TaskCenterError) as caught:
resume_preflight(service, result)
assert caught.value.code == 'run_blocked'
return
assert result['resume_ready'], result['blockers']
report = resume_preflight(service, result)
assert report['ready']
assert report['tasks'][0]['isolated'] == isolated
assert report['tasks'][0]['isolated'] is False
def test_unpaused_blocked_project_is_not_a_completed_run(project_service):