From 7f37ac8b1d28b38d4529f43dddd5e74a781180eb Mon Sep 17 00:00:00 2001 From: Hendrik Muhs Date: Tue, 28 Jan 2020 13:36:23 +0100 Subject: [PATCH] [Transform] fix TransformRobustnessIT intermittent test failures part 2 (#51523) add wait for completion in transform robustness test to avoid occasional test failures during cleanup fixes #51347 --- .../xpack/transform/integration/TransformRobustnessIT.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformRobustnessIT.java b/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformRobustnessIT.java index 0a9b5ca68ac16..459f2e9e56844 100644 --- a/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformRobustnessIT.java +++ b/x-pack/plugin/transform/qa/single-node-tests/src/test/java/org/elasticsearch/xpack/transform/integration/TransformRobustnessIT.java @@ -81,11 +81,15 @@ public void testTaskRemovalAfterInternalIndexGotDeleted() throws Exception { containsString("Detected transforms with no config [" + transformId + "]. Use force to stop/delete them.") ); stopTransformRequest.addParameter(TransformField.FORCE.getPreferredName(), Boolean.toString(true)); + + // make sync, to avoid in-flux state, see gh#51347 + stopTransformRequest.addParameter(TransformField.WAIT_FOR_COMPLETION.getPreferredName(), Boolean.toString(true)); + Map stopTransformResponse = entityAsMap(client().performRequest(stopTransformRequest)); assertThat(stopTransformResponse.get("acknowledged"), equalTo(Boolean.TRUE)); // the task is gone - assertEquals(1, getNumberOfTransformTasks()); + assertEquals(0, getNumberOfTransformTasks()); } @SuppressWarnings("unchecked")