diff --git a/x-pack/plugin/ilm/qa/multi-node/build.gradle b/x-pack/plugin/ilm/qa/multi-node/build.gradle index d8dbb2f130f..edd7f3aad47 100644 --- a/x-pack/plugin/ilm/qa/multi-node/build.gradle +++ b/x-pack/plugin/ilm/qa/multi-node/build.gradle @@ -15,6 +15,6 @@ integTestCluster { setting 'xpack.monitoring.enabled', 'false' setting 'xpack.ml.enabled', 'false' setting 'xpack.license.self_generated.type', 'trial' - setting 'indices.lifecycle.poll_interval', '2500ms' + setting 'indices.lifecycle.poll_interval', '1000ms' } diff --git a/x-pack/plugin/ilm/qa/multi-node/src/test/java/org/elasticsearch/xpack/indexlifecycle/TimeSeriesLifecycleActionsIT.java b/x-pack/plugin/ilm/qa/multi-node/src/test/java/org/elasticsearch/xpack/indexlifecycle/TimeSeriesLifecycleActionsIT.java index c06b30cf575..352f52bd1aa 100644 --- a/x-pack/plugin/ilm/qa/multi-node/src/test/java/org/elasticsearch/xpack/indexlifecycle/TimeSeriesLifecycleActionsIT.java +++ b/x-pack/plugin/ilm/qa/multi-node/src/test/java/org/elasticsearch/xpack/indexlifecycle/TimeSeriesLifecycleActionsIT.java @@ -82,9 +82,19 @@ public class TimeSeriesLifecycleActionsIT extends ESRestTestCase { updatePolicy(originalIndex, policy); // index document {"foo": "bar"} to trigger rollover index(client(), originalIndex, "_id", "foo", "bar"); + + /* + * These asserts are in the order that they should be satisfied in, in + * order to maximize the time for all operations to complete. + * An "out of order" assert here may result in this test occasionally + * timing out and failing inappropriately. + */ + // asserts that rollover was called assertBusy(() -> assertTrue(indexExists(secondIndex))); - assertBusy(() -> assertFalse(indexExists(shrunkenOriginalIndex))); + // asserts that shrink deleted the original index assertBusy(() -> assertFalse(indexExists(originalIndex))); + // asserts that the delete phase completed for the managed shrunken index + assertBusy(() -> assertFalse(indexExists(shrunkenOriginalIndex))); } public void testMoveToAllocateStep() throws Exception { @@ -150,9 +160,19 @@ public class TimeSeriesLifecycleActionsIT extends ESRestTestCase { " }\n" + "}"); client().performRequest(moveToStepRequest); + + /* + * These asserts are in the order that they should be satisfied in, in + * order to maximize the time for all operations to complete. + * An "out of order" assert here may result in this test occasionally + * timing out and failing inappropriately. + */ + // asserts that rollover was called assertBusy(() -> assertTrue(indexExists(secondIndex))); - assertBusy(() -> assertFalse(indexExists(shrunkenOriginalIndex))); + // asserts that shrink deleted the original index assertBusy(() -> assertFalse(indexExists(originalIndex))); + // asserts that the delete phase completed for the managed shrunken index + assertBusy(() -> assertFalse(indexExists(shrunkenOriginalIndex))); } public void testRolloverAction() throws Exception {