sched: checkpoint-first reconcile across torn checkpoint/summary writes (F2)
This commit is contained in:
@@ -88,3 +88,24 @@ class ScriptedDispatcher:
|
||||
def finish(self, admission: RunAdmission, outcome: str) -> RunState:
|
||||
"""Build the stopped state that settles a hanging run."""
|
||||
return stopped_state(admission, outcome)
|
||||
|
||||
|
||||
class WorkflowDispatcher:
|
||||
"""Execution double driving a real workflow to its first stopped state.
|
||||
|
||||
Dispatch runs the workflow through the genuine ``wf_core`` runtime and
|
||||
returns the resulting stopped state, so scheduler tests exercise real
|
||||
execution (including durable interruptions) without enabling any server.
|
||||
"""
|
||||
|
||||
def __init__(self, workflow: Any, registry: dict[str, Any] | None = None) -> None:
|
||||
self.workflow = workflow
|
||||
self.registry = registry or {}
|
||||
|
||||
def dispatch(self, *, admission: RunAdmission, now: datetime) -> DispatchResult:
|
||||
from wf_core import execute_workflow
|
||||
|
||||
state = execute_workflow(
|
||||
self.workflow, dict(admission.resolved_input), self.registry
|
||||
)
|
||||
return Stopped(result=state)
|
||||
|
||||
Reference in New Issue
Block a user