A batch run fails a node with no value on a triggering input instead of calling it, naming the input and its producer, and skips what waits on it
This commit is contained in:
@@ -780,6 +780,54 @@ def test_a_failed_stage_skips_what_waits_on_it_and_fails_the_run(tmp_path):
|
||||
session.commit()
|
||||
|
||||
|
||||
def test_a_stage_with_nothing_on_an_input_fails_instead_of_being_called(tmp_path):
|
||||
"""The producer succeeded but published nothing on the port it waits on."""
|
||||
model, score, report = (
|
||||
MessageSpec(name=n, dtype=DType.FLOAT) for n in ("model", "score", "report")
|
||||
)
|
||||
flow = FlowDef(
|
||||
name="split",
|
||||
mode="batch",
|
||||
nodes=[
|
||||
NodeDef(id="fit", provides=[model, score]),
|
||||
NodeDef(id="readout", requires=[score], provides=[report]),
|
||||
NodeDef(id="evaluate", requires=[report]),
|
||||
],
|
||||
)
|
||||
store = FlowStore(tmp_path / "flows")
|
||||
store.write_flow(flow)
|
||||
store.write_node_source(
|
||||
"split", "fit", "def process():\n return {'model': 1.0}\n"
|
||||
)
|
||||
store.write_node_source(
|
||||
"split", "readout", "def process(score):\n return {'report': score}\n"
|
||||
)
|
||||
store.write_node_source("split", "evaluate", "def process(report):\n pass\n")
|
||||
|
||||
service = RunService(controller=FlowController(store), queue=_Collect())
|
||||
run_id = service.submit("split", {}).id
|
||||
try:
|
||||
service._drive(run_id)
|
||||
with Session(db_engine) as session:
|
||||
assert session.get(Run, run_id).status == "error"
|
||||
rows = {
|
||||
row.node: row
|
||||
for row in session.exec(select(RunNode).where(RunNode.run_id == run_id))
|
||||
}
|
||||
assert {node: row.status for node, row in rows.items()} == {
|
||||
"split.fit": "ok",
|
||||
"split.readout": "error",
|
||||
"split.evaluate": "skipped",
|
||||
}
|
||||
assert rows["split.readout"].error == "No value on input 'score' from 'fit'"
|
||||
finally:
|
||||
with Session(db_engine) as session:
|
||||
for node in session.exec(select(RunNode).where(RunNode.run_id == run_id)):
|
||||
session.delete(node)
|
||||
session.delete(session.get(Run, run_id))
|
||||
session.commit()
|
||||
|
||||
|
||||
def test_a_retry_is_a_new_run_that_names_the_one_it_repeats():
|
||||
"""The way back from a run an engine restart interrupted.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user