diff --git a/src/dx_productivity/trial_task_center/quick_run.py b/src/dx_productivity/trial_task_center/quick_run.py index 0144217..1e17044 100644 --- a/src/dx_productivity/trial_task_center/quick_run.py +++ b/src/dx_productivity/trial_task_center/quick_run.py @@ -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: diff --git a/tests/v1_1/test_target_execution.py b/tests/v1_1/test_target_execution.py index e60c617..af605b4 100644 --- a/tests/v1_1/test_target_execution.py +++ b/tests/v1_1/test_target_execution.py @@ -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):