Skip to content

Commit 77dd2ab

Browse files
committed
Add additional wait conditions to test
1 parent 11ef3c8 commit 77dd2ab

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

x-pack/plugin/ilm/qa/multi-node/src/test/java/org/elasticsearch/xpack/ilm/TimeSeriesLifecycleActionsIT.java

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.elasticsearch.test.rest.ESRestTestCase;
2828
import org.elasticsearch.xpack.core.ilm.AllocateAction;
2929
import org.elasticsearch.xpack.core.ilm.DeleteAction;
30+
import org.elasticsearch.xpack.core.ilm.ErrorStep;
3031
import org.elasticsearch.xpack.core.ilm.ForceMergeAction;
3132
import org.elasticsearch.xpack.core.ilm.FreezeAction;
3233
import org.elasticsearch.xpack.core.ilm.LifecycleAction;
@@ -1103,6 +1104,8 @@ public void testHistoryIsWrittenWithSuccess() throws Exception {
11031104
Request refreshIndex = new Request("POST", "/" + index + "-1/_refresh");
11041105
client().performRequest(refreshIndex);
11051106

1107+
assertBusy(() -> assertThat(getStepKeyForIndex(index + "-1"), equalTo(TerminalPolicyStep.KEY)));
1108+
11061109
assertBusy(() -> assertHistoryIsPresent(policy, index + "-1", true, "wait-for-indexing-complete"), 30, TimeUnit.SECONDS);
11071110
assertBusy(() -> assertHistoryIsPresent(policy, index + "-1", true, "wait-for-follow-shard-tasks"), 30, TimeUnit.SECONDS);
11081111
assertBusy(() -> assertHistoryIsPresent(policy, index + "-1", true, "pause-follower-index"), 30, TimeUnit.SECONDS);
@@ -1145,6 +1148,8 @@ public void testHistoryIsWrittenWithFailure() throws Exception {
11451148
Request refreshIndex = new Request("POST", "/" + index + "-1/_refresh");
11461149
client().performRequest(refreshIndex);
11471150

1151+
assertBusy(() -> assertThat(getStepKeyForIndex(index + "-1").getName(), equalTo(ErrorStep.NAME)));
1152+
11481153
assertBusy(() -> assertHistoryIsPresent(policy, index + "-1", false, "ERROR"), 30, TimeUnit.SECONDS);
11491154
}
11501155

0 commit comments

Comments
 (0)