[model-gateway] Optimize workflow engine with pre-computed dependency graph (#15503)

This commit is contained in:
Simo Lin
2025-12-19 15:44:57 -08:00
committed by GitHub
parent ba72e759ca
commit 0adfc42b99
3 changed files with 76 additions and 41 deletions
+3 -3
View File
@@ -598,7 +598,7 @@ async fn test_dag_dependency_failure_blocks_dependents() {
#[test]
fn test_dag_validation_cycle_detection() {
// Create a workflow with a cycle: A -> B -> C -> A
let workflow = WorkflowDefinition::new("cyclic_workflow", "Cyclic Test")
let mut workflow = WorkflowDefinition::new("cyclic_workflow", "Cyclic Test")
.add_step(
StepDefinition::new("step_a", "Step A", Arc::new(AlwaysSucceedStep))
.depends_on(&["step_c"]),
@@ -620,7 +620,7 @@ fn test_dag_validation_cycle_detection() {
#[test]
fn test_dag_validation_missing_dependency() {
// Create a workflow with a missing dependency
let workflow = WorkflowDefinition::new("missing_dep_workflow", "Missing Dep Test")
let mut workflow = WorkflowDefinition::new("missing_dep_workflow", "Missing Dep Test")
.add_step(StepDefinition::new(
"step_a",
"Step A",
@@ -639,7 +639,7 @@ fn test_dag_validation_missing_dependency() {
#[test]
fn test_dag_validation_valid_workflow() {
// Create a valid DAG workflow
let workflow = WorkflowDefinition::new("valid_workflow", "Valid Test")
let mut workflow = WorkflowDefinition::new("valid_workflow", "Valid Test")
.add_step(StepDefinition::new(
"step_a",
"Step A",