fix: resume frozen task queue after verified resource release
Core regression / Python core, intervention UI and release configuration (push) Successful in 5m2s
Core regression / JavaScript syntax (push) Successful in 7s
Core regression / Python core, intervention UI and release configuration (pull_request) Successful in 5m32s
Core regression / JavaScript syntax (pull_request) Successful in 8s
Core regression / Python core, intervention UI and release configuration (push) Successful in 5m2s
Core regression / JavaScript syntax (push) Successful in 7s
Core regression / Python core, intervention UI and release configuration (pull_request) Successful in 5m32s
Core regression / JavaScript syntax (pull_request) Successful in 8s
This commit is contained in:
1 parent
d0bbc73da3
commit
6d45ea1fa0
12 files changed
+1259
-14
No files matched your search
@@ -96,6 +96,30 @@ def test_inspect_accepts_frozen_workspace_checkpoint(project_service):
|
||||
assert result['remaining_task_ids'] == ids
|
||||
|
||||
|
||||
def test_inspect_restores_a_legacy_resource_pause_only_from_its_original_batch(project_service, monkeypatch):
|
||||
from dx_productivity.trial_task_center import task_queue
|
||||
service, _, data, ids, hashes = project_service
|
||||
journal = RunJournal(data)
|
||||
token, batch_id = 'a' * 32, 'b' * 32
|
||||
journal.begin(token, ids, hashes)
|
||||
checkpoint(data, token, ids, hashes, {ids[0]: 'blocked'})
|
||||
path = data / 'task-queues' / (token + '.json')
|
||||
state = json.loads(path.read_bytes())
|
||||
path.write_text(json.dumps(dict(state, phase='primary')), encoding='utf-8')
|
||||
journal.finish(token, {'status': 'blocked', 'paused': True, 'user_pause_requested': False})
|
||||
archive = data / 'batch-resources' / batch_id / 'result.json'
|
||||
archive.parent.mkdir(parents=True)
|
||||
archive.touch()
|
||||
monkeypatch.setattr(task_queue, 'resource_pause_admitted', lambda root, owner, tasks, plan:
|
||||
TaskQueueResult(token, (), True, ids[0]) if owner == batch_id and tuple(ids) == tasks and hashes == plan else False)
|
||||
result = journal.inspect(service, token)
|
||||
assert result['resource_batch_id'] == batch_id
|
||||
assert result['isolated_task_ids'] == ids[:1]
|
||||
assert result['remaining_task_ids'] == ids[1:]
|
||||
journal.finish(token, {'status': 'blocked', 'paused': True, 'user_pause_requested': True})
|
||||
assert journal.inspect(service, token)['resource_batch_id'] is None
|
||||
|
||||
|
||||
@pytest.mark.parametrize('interrupted', [False, True])
|
||||
def test_shared_safe_primary_failure_can_hold_remaining_commands_on_resume(project_service, monkeypatch, interrupted):
|
||||
from dataclasses import replace
|
||||
|
||||
Reference in new issue
Block a user