diff --git a/muted-tests.yml b/muted-tests.yml index 616e136d7864a..4b41716377580 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -302,9 +302,6 @@ tests: - class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryStopIT method: testStopQueryLocal issue: https://github.com/elastic/elasticsearch/issues/121672 -- class: org.elasticsearch.integration.DataStreamLifecycleServiceRuntimeSecurityIT - method: testRolloverLifecycleAndForceMergeAuthorized - issue: https://github.com/elastic/elasticsearch/issues/124978 - class: org.elasticsearch.packaging.test.BootstrapCheckTests method: test10Install issue: https://github.com/elastic/elasticsearch/issues/124957 diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DataStreamLifecycleServiceRuntimeSecurityIT.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DataStreamLifecycleServiceRuntimeSecurityIT.java index 9f24c5240d3fa..c1a031823a25b 100644 --- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DataStreamLifecycleServiceRuntimeSecurityIT.java +++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DataStreamLifecycleServiceRuntimeSecurityIT.java @@ -97,23 +97,19 @@ public void testRolloverLifecycleAndForceMergeAuthorized() throws Exception { // empty lifecycle contains the default rollover prepareDataStreamAndIndex(dataStreamName, DataStreamLifecycle.Template.DEFAULT); - assertBusy(() -> { - assertNoAuthzErrors(); - List backingIndices = getDataStreamBackingIndices(dataStreamName); - assertThat(backingIndices.size(), equalTo(2)); - String backingIndex = backingIndices.get(0).getName(); - assertThat(backingIndex, backingIndexEqualTo(dataStreamName, 1)); - String writeIndex = backingIndices.get(1).getName(); - assertThat(writeIndex, backingIndexEqualTo(dataStreamName, 2)); - }); + List backingIndices = waitForDataStreamBackingIndices(dataStreamName, 2); + String backingIndex = backingIndices.get(0); + assertThat(backingIndex, backingIndexEqualTo(dataStreamName, 1)); + String writeIndex = backingIndices.get(1); + assertThat(writeIndex, backingIndexEqualTo(dataStreamName, 2)); + + assertNoAuthzErrors(); // Index another doc to force another rollover and trigger an attempted force-merge. The force-merge may be a noop under // the hood but for authz purposes this doesn't matter, it only matters that the force-merge API was called indexDoc(dataStreamName); - assertBusy(() -> { - assertNoAuthzErrors(); - List backingIndices = getDataStreamBackingIndices(dataStreamName); - assertThat(backingIndices.size(), equalTo(3)); - }); + + waitForDataStreamBackingIndices(dataStreamName, 3); + assertNoAuthzErrors(); } public void testRolloverAndRetentionAuthorized() throws Exception {