better error traces

This commit is contained in:
lda
2026-05-22 01:07:04 +07:00 Verified
parent 46d384e69a
commit 4fa0beab8c
2 changed files with 35 additions and 2 deletions
+15
View File
@@ -13,6 +13,7 @@ from wf_core.runtime.scheduler import (
block_frame_on_children,
enqueue_frame,
select_next_frame,
resolve_no_ready_frames,
wake_frame,
wake_parent_if_children_complete,
)
@@ -162,3 +163,17 @@ def test_resume_wakes_interrupted_frame_at_front() -> None:
wake_frame(run, "waiting", front=True)
assert run.ready_frame_ids == ["waiting", "sibling"]
def test_deadlock_error_includes_ready_queue_and_frame_summary() -> None:
run = _run()
add_frame(run, ExecutionFrame(id="parent", kind="root", node_id="foreach"))
block_frame_on_children(run, "parent", ("missing_child",))
with pytest.raises(WorkflowExecutionError) as exc_info:
resolve_no_ready_frames(run)
message = str(exc_info.value)
assert "deadlocked" in message
assert "ready_frame_ids=[]" in message
assert "parent:blocked@foreach" in message