feat: 增加失败任务重试与 CUDA 动态库路径注入
This commit is contained in:
@@ -142,3 +142,44 @@ def test_run_and_artifact_crud(tmp_path) -> None:
|
||||
|
||||
db.delete_run_artifacts("run_1")
|
||||
assert db.list_artifacts("run_1") == []
|
||||
|
||||
|
||||
def test_reset_run_clears_error_and_artifacts(tmp_path) -> None:
|
||||
db = Database(tmp_path / "wov.db")
|
||||
db.upsert_workflow({"id": "demo", "name": "Demo", "published": 1, "latest_version": 1})
|
||||
now = "2026-01-01T00:00:00+00:00"
|
||||
db.create_run(
|
||||
{
|
||||
"id": "run_1",
|
||||
"workflow_id": "demo",
|
||||
"workflow_version": 1,
|
||||
"status": "FAILED",
|
||||
"progress": 0.75,
|
||||
"current_node_id": "translate",
|
||||
"error": "timed out",
|
||||
"input_uri": "in.txt",
|
||||
"created_at": now,
|
||||
"updated_at": now,
|
||||
}
|
||||
)
|
||||
db.create_artifact(
|
||||
{
|
||||
"run_id": "run_1",
|
||||
"node_id": "asr",
|
||||
"name": "asr.srt_uri",
|
||||
"uri": "out.srt",
|
||||
"mime_type": "application/x-subrip",
|
||||
"size": 3,
|
||||
}
|
||||
)
|
||||
|
||||
db.reset_run("run_1", "2026-01-02T00:00:00+00:00")
|
||||
|
||||
run = db.get_run("run_1")
|
||||
assert run["status"] == "QUEUED"
|
||||
assert run["progress"] == 0
|
||||
assert run["current_node_id"] is None
|
||||
assert run["error"] is None
|
||||
assert run["updated_at"] == "2026-01-02T00:00:00+00:00"
|
||||
assert run["created_at"] == now
|
||||
assert db.list_artifacts("run_1") == []
|
||||
|
||||
Reference in New Issue
Block a user