From 258d4fa9370acd66c8a0635c00655525c7f09bf6 Mon Sep 17 00:00:00 2001 From: Jackie Han Date: Fri, 22 Dec 2023 13:51:00 -0800 Subject: [PATCH] Add thread sleep to wait for deletion to complete Signed-off-by: Jackie Han --- .../opensearch/flowframework/rest/FlowFrameworkRestApiIT.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test/java/org/opensearch/flowframework/rest/FlowFrameworkRestApiIT.java b/src/test/java/org/opensearch/flowframework/rest/FlowFrameworkRestApiIT.java index 6999d2779..cfc5919d4 100644 --- a/src/test/java/org/opensearch/flowframework/rest/FlowFrameworkRestApiIT.java +++ b/src/test/java/org/opensearch/flowframework/rest/FlowFrameworkRestApiIT.java @@ -224,9 +224,13 @@ public void testCreateAndProvisionAgentFrameworkWorkflow() throws Exception { Response deleteResponse = deleteWorkflow(workflowId); assertEquals(RestStatus.OK, TestHelpers.restStatus(deleteResponse)); + // wait for deletion to complete + Thread.sleep(30000); + // Search this workflow id in global_context index to make sure it's deleted SearchResponse searchResponseAfterDeletion = searchWorkflows(query); assertBusy(() -> assertEquals(0, searchResponseAfterDeletion.getHits().getTotalHits().value), 30, TimeUnit.SECONDS); + } }