Track latest unverified queue state

This commit is contained in:
阿白叔 committed 2026-10-14 13:31:52 +08:00
1 parent 235a1005e9
commit f3d0d7a93d
2 files changed
+19 -1

No files matched your search

@@ -570,7 +570,8 @@ class QuickRunPreparer:
try:
commands = _read_commands(root / "command.tsv")
statuses = _read_status_details(root / "status.tsv")
if any(state == BATCH_SAVED_UNVERIFIED_STATE for _, state, _, _ in statuses):
latest_states = {job_id: state for job_id, state, _, _ in statuses}
if any(state == BATCH_SAVED_UNVERIFIED_STATE for state in latest_states.values()):
return True
current = _next_unfinished_command(commands, statuses)
if current is None:
+17
View File
@@ -62,6 +62,23 @@ def test_recovery_selects_saved_unverified_job_before_next_pending_job():
assert _recovery_command(commands, statuses) == commands[0]
def test_recovered_unverified_job_no_longer_blocks_queue(tmp_path):
script = tmp_path / 'QuickPartReplace.vbs'
script.write_text("' fixture\n", encoding='ascii')
preparer = QuickRunPreparer(tmp_path / 'data', script_source=script)
root = tmp_path / 'data' / 'quick-run'
root.mkdir(parents=True)
(root / 'command.tsv').write_text(
'task_id\tjob_id\tproject_path\told_part\tnew_part\n'
't\ta\tboard.prj\tOLD\tNEW\n', encoding='utf-8')
(root / 'status.tsv').write_text(
'job_id\tstate\tcode\tmessage\n'
'a\tbatch_saved_unverified\t\treadback failed\n'
'a\trestored_ok\t\trecovered\n', encoding='utf-8')
assert preparer.has_interrupted('t') is False
def test_native_context_rejects_missing_or_changed_target_without_no_match():
class Component:
def __init__(self, uid, refdes, part, value):