From 2b106216b80e244f3cf339b4e248ec89b2592ab3 Mon Sep 17 00:00:00 2001 From: Daniel Widdis Date: Wed, 20 Dec 2023 13:49:52 -0800 Subject: [PATCH] Make ITs more robust with longer timeouts (#306) Comment-out incompleted implementation and extend timeouts Signed-off-by: Daniel Widdis --- .../flowframework/FlowFrameworkRestTestCase.java | 3 +-- .../flowframework/rest/FlowFrameworkRestApiIT.java | 14 ++++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/test/java/org/opensearch/flowframework/FlowFrameworkRestTestCase.java b/src/test/java/org/opensearch/flowframework/FlowFrameworkRestTestCase.java index ac537047f..447dea20c 100644 --- a/src/test/java/org/opensearch/flowframework/FlowFrameworkRestTestCase.java +++ b/src/test/java/org/opensearch/flowframework/FlowFrameworkRestTestCase.java @@ -122,8 +122,7 @@ public void setUpSettings() throws Exception { assertEquals(200, response.getStatusLine().getStatusCode()); // Ensure .plugins-ml-config is created before proceeding with integration tests - assertBusy(() -> { assertTrue(indexExistsWithAdminClient(".plugins-ml-config")); }); - + assertBusy(() -> { assertTrue(indexExistsWithAdminClient(".plugins-ml-config")); }, 30, TimeUnit.SECONDS); } } diff --git a/src/test/java/org/opensearch/flowframework/rest/FlowFrameworkRestApiIT.java b/src/test/java/org/opensearch/flowframework/rest/FlowFrameworkRestApiIT.java index e8a99946e..f4124f28d 100644 --- a/src/test/java/org/opensearch/flowframework/rest/FlowFrameworkRestApiIT.java +++ b/src/test/java/org/opensearch/flowframework/rest/FlowFrameworkRestApiIT.java @@ -22,11 +22,9 @@ import org.opensearch.flowframework.model.WorkflowEdge; import org.opensearch.flowframework.model.WorkflowNode; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; import static org.opensearch.flowframework.common.CommonValue.CREDENTIAL_FIELD; import static org.opensearch.flowframework.common.CommonValue.PROVISION_WORKFLOW; @@ -65,6 +63,8 @@ public void testSearchWorkflows() throws Exception { } public void testCreateAndProvisionLocalModelWorkflow() throws Exception { + /*- Local model registration is not yet fully complete. Commenting this test out until it is. + * https://github.com/opensearch-project/flow-framework/issues/305 // Using a 3 step template to create a model group, register a remote model and deploy model Template template = TestHelpers.createTemplateFromFile("registerlocalmodel-deploymodel.json"); @@ -117,14 +117,12 @@ public void testCreateAndProvisionLocalModelWorkflow() throws Exception { assertEquals(RestStatus.OK, TestHelpers.restStatus(response)); getAndAssertWorkflowStatus(workflowId, State.PROVISIONING, ProvisioningProgress.IN_PROGRESS); - // TODO: This provisioning isn't completing, probably due to incorrect task vs. model ID in RetryableWorkflowStep - // May be fixed by https://github.com/opensearch-project/flow-framework/pull/298 // Wait until provisioning has completed successfully before attempting to retrieve created resources - // List resourcesCreated = getResourcesCreated(workflowId, 100); + List resourcesCreated = getResourcesCreated(workflowId, 100); // TODO: This template should create 2 resources, registered_model_id and deployed model_id - // But RegisterLocalModelStep does not yet update state index so might be 1 - // assertEquals(0, resourcesCreated.size()); + assertEquals(0, resourcesCreated.size()); + */ } public void testCreateAndProvisionRemoteModelWorkflow() throws Exception { @@ -168,7 +166,7 @@ public void testCreateAndProvisionRemoteModelWorkflow() throws Exception { getAndAssertWorkflowStatus(workflowId, State.PROVISIONING, ProvisioningProgress.IN_PROGRESS); // Wait until provisioning has completed successfully before attempting to retrieve created resources - List resourcesCreated = getResourcesCreated(workflowId, 10); + List resourcesCreated = getResourcesCreated(workflowId, 30); // This template should create 3 resources, connector_id, regestered model_id and deployed model_id assertEquals(3, resourcesCreated.size());