fix(scada): verify recovery after replay work-order completion
Generic Container CI/CD / test-build-publish (push) Successful in 3m58s
Server CI/CD v2 / build-test-publish-and-deploy (push) Successful in 3m58s

This commit is contained in:
2026-11-07 23:12:42 +08:00
parent 06d8539aa8
commit 2a7b96f813
7 changed files with 61 additions and 10 deletions
+9 -1
View File
@@ -97,8 +97,13 @@ def test_off_grid_feedback_uses_first_later_sample_even_without_monitoring_inter
assert result["verified_through"] == (RETURNED + timedelta(minutes=15)).isoformat()
def test_dispatch_waits_for_all_orders_and_accepts_corrected_field_completion_time():
@pytest.mark.parametrize("replay", [False, True])
def test_dispatch_waits_for_all_orders_and_accepts_corrected_field_completion_time(replay):
task = {"workflow": "burst_report"}
if replay:
task["source"] = {"replay_context": {
"replay_id": str(uuid4()), "knowledge_cutoff": INCIDENT.isoformat(), "batch_sequence": 3,
}}
for order_id in ("one", "two"):
track_work_order(task, {"kind": "create_work_order", "action_id": str(uuid4()), "execution_status": "succeeded",
"receipt": {"adapter": "peripheral_sample", "receipt_id": order_id}})
@@ -120,6 +125,9 @@ def test_dispatch_waits_for_all_orders_and_accepts_corrected_field_completion_ti
assert task["handling_context"]["returned_at"] == corrected.isoformat()
assert task["handling_context"]["phase"] == "waiting_scada"
assert "verification_evidence_id" not in task["handling_context"] and "last_check" not in task["handling_context"]
if replay:
assert task["source"]["replay_context"]["knowledge_cutoff"] == INCIDENT.isoformat()
assert task["source"]["replay_context"]["batch_sequence"] == 3
def test_field_feedback_time_requires_a_real_note_and_explicit_timezone():