From 22eaab004a6bd3e73d2c8e62d82ffdde16a6a686 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 09:12:00 -0800 Subject: [PATCH] [Backport 2.x] Revert PR #880: Remove temporary fix for integration tests (#931) Revert PR #880: Remove temporary fix for integration tests (#930) (cherry picked from commit 79bd8597a83fc03c12812d53ea30d27f6e0c0704) Signed-off-by: saimedhi Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- .../flowframework/rest/FlowFrameworkRestApiIT.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/test/java/org/opensearch/flowframework/rest/FlowFrameworkRestApiIT.java b/src/test/java/org/opensearch/flowframework/rest/FlowFrameworkRestApiIT.java index 2ded10e3..c437c32e 100644 --- a/src/test/java/org/opensearch/flowframework/rest/FlowFrameworkRestApiIT.java +++ b/src/test/java/org/opensearch/flowframework/rest/FlowFrameworkRestApiIT.java @@ -451,7 +451,6 @@ public void testReprovisionWorkflow() throws Exception { assertTrue(getPipelineResponse.pipelines().get(0).getConfigAsMap().toString().contains(modelId)); // Reprovision template to add index which uses default ingest pipeline - Instant preUpdateTime = Instant.now(); // Store a timestamp template = TestHelpers.createTemplateFromFile("registerremotemodel-ingestpipeline-createindex.json"); response = reprovisionWorkflow(client(), workflowId, template); assertEquals(RestStatus.CREATED, TestHelpers.restStatus(response)); @@ -469,17 +468,6 @@ public void testReprovisionWorkflow() throws Exception { Map indexSettings = getIndexSettingsAsMap(indexName); assertEquals(pipelineId, indexSettings.get("index.default_pipeline")); - // The template doesn't get updated until after the resources are created which can cause a race condition and flaky failure - // See https://github.com/opensearch-project/flow-framework/issues/870 - // Making sure the template got updated before reprovisioning again. - // Quick fix to stop this from being flaky, needs a more permanent fix to synchronize template update with COMPLETED provisioning - assertBusy(() -> { - Response r = getWorkflow(client(), workflowId); - assertEquals(RestStatus.OK.getStatus(), r.getStatusLine().getStatusCode()); - Template t = Template.parse(EntityUtils.toString(r.getEntity(), StandardCharsets.UTF_8)); - assertTrue(t.lastUpdatedTime().isAfter(preUpdateTime)); - }, 30, TimeUnit.SECONDS); - // Reprovision template to remove default ingest pipeline template = TestHelpers.createTemplateFromFile("registerremotemodel-ingestpipeline-updateindex.json"); response = reprovisionWorkflow(client(), workflowId, template);