From 518ff1ab1d400d7319b051e56dae8fb4f5031fed Mon Sep 17 00:00:00 2001 From: Hendrik Muhs Date: Fri, 24 Jan 2020 15:18:19 +0100 Subject: [PATCH] fix TransformRobustnessIT intermittent test failures ensure the cluster is not in some intermediate state when cleaning up. fixes #51347 --- .../transform/integration/TransformRestTestCase.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformRestTestCase.java b/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformRestTestCase.java index d9c61dddeab47..2d4adae7aaa8a 100644 --- a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformRestTestCase.java +++ b/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformRestTestCase.java @@ -363,9 +363,12 @@ protected static void deleteTransform(String transformId) throws IOException { } @After - public void waitForDataFrame() throws Exception { - wipeTransforms(); - waitForPendingDataFrameTasks(); + public void waitForTransform() throws Exception { + if (preserveClusterUponCompletion() == false) { + ensureNoInitializingShards(); + wipeTransforms(); + waitForPendingTransformTasks(); + } } @AfterClass @@ -416,7 +419,7 @@ public void wipeTransforms() throws IOException { } } - protected static void waitForPendingDataFrameTasks() throws Exception { + protected static void waitForPendingTransformTasks() throws Exception { waitForPendingTasks(adminClient(), taskName -> taskName.startsWith(TransformField.TASK_NAME) == false); }