From 2933dab097bfcc31ac42fc2c97411ecd4dd85dcc Mon Sep 17 00:00:00 2001 From: Daniel Widdis Date: Wed, 27 Dec 2023 20:04:56 -0800 Subject: [PATCH] Fix integ test to make sure we get proper error Signed-off-by: Daniel Widdis --- .../flowframework/rest/FlowFrameworkRestApiIT.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/opensearch/flowframework/rest/FlowFrameworkRestApiIT.java b/src/test/java/org/opensearch/flowframework/rest/FlowFrameworkRestApiIT.java index 8fa2fa43d..058d2b898 100644 --- a/src/test/java/org/opensearch/flowframework/rest/FlowFrameworkRestApiIT.java +++ b/src/test/java/org/opensearch/flowframework/rest/FlowFrameworkRestApiIT.java @@ -140,7 +140,7 @@ public void testCreateAndProvisionRemoteModelWorkflow() throws Exception { Workflow cyclicalWorkflow = new Workflow( originalWorkflow.userParams(), originalWorkflow.nodes(), - List.of(new WorkflowEdge("workflow_step_1", "workflow_step_2"), new WorkflowEdge("workflow_step_2", "workflow_step_1")) + List.of(new WorkflowEdge("workflow_step_2", "workflow_step_3"), new WorkflowEdge("workflow_step_3", "workflow_step_2")) ); Template cyclicalTemplate = new Template.Builder().name(template.name()) @@ -155,7 +155,10 @@ public void testCreateAndProvisionRemoteModelWorkflow() throws Exception { // Hit dry run ResponseException exception = expectThrows(ResponseException.class, () -> createWorkflowValidation(cyclicalTemplate)); - assertTrue(exception.getMessage().contains("Cycle detected: [workflow_step_2->workflow_step_1, workflow_step_1->workflow_step_2]")); + // output order not guaranteed + assertTrue(exception.getMessage().contains("Cycle detected")); + assertTrue(exception.getMessage().contains("workflow_step_2->workflow_step_3")); + assertTrue(exception.getMessage().contains("workflow_step_3->workflow_step_2")); // Hit Create Workflow API with original template Response response = createWorkflow(template);