Skip to content

Commit 1fb73ef

Browse files
Fix ChangePolicyforIndexIT.testChangePolicyForIndex (#75003) (#75020)
The `check-rollover-ready` step is subject to the refresh making the doc count stats available. The `refresh` execution is not deterministic (especially for indices that are not queried) so the index might end up staying in the `hot` phase and failing the test. This triggers the refresh when writting to the index. Co-authored-by: Andrei Dan <[email protected]>
1 parent a5b5fa2 commit 1fb73ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/ChangePolicyforIndexIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
import org.elasticsearch.cluster.metadata.IndexMetadata;
1515
import org.elasticsearch.common.Strings;
1616
import org.elasticsearch.common.settings.Settings;
17-
import org.elasticsearch.core.TimeValue;
1817
import org.elasticsearch.common.xcontent.XContentBuilder;
18+
import org.elasticsearch.core.TimeValue;
1919
import org.elasticsearch.test.rest.ESRestTestCase;
2020
import org.elasticsearch.xpack.core.ilm.AllocateAction;
2121
import org.elasticsearch.xpack.core.ilm.LifecyclePolicy;
@@ -111,7 +111,7 @@ public void testChangePolicyForIndex() throws Exception {
111111
XContentBuilder document = jsonBuilder().startObject();
112112
document.field("foo", "bar");
113113
document.endObject();
114-
final Request request = new Request("POST", "/" + indexName + "/_doc/1");
114+
final Request request = new Request("POST", "/" + indexName + "/_doc/1?refresh");
115115
request.setJsonEntity(Strings.toString(document));
116116
assertOK(client().performRequest(request));
117117

0 commit comments

Comments
 (0)