diff --git a/muted-tests.yml b/muted-tests.yml index 5487810e2fe1e..6b52f2456dc1e 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -535,9 +535,6 @@ tests: - class: org.elasticsearch.test.rest.yaml.RcsCcsCommonYamlTestSuiteIT method: test {p0=field_caps/40_time_series/Get simple time series field caps} issue: https://github.com/elastic/elasticsearch/issues/131225 -- class: org.elasticsearch.cluster.routing.allocation.DiskThresholdMonitorIT - method: testFloodStageExceeded - issue: https://github.com/elastic/elasticsearch/issues/131146 - class: org.elasticsearch.packaging.test.DockerTests method: test090SecurityCliPackaging issue: https://github.com/elastic/elasticsearch/issues/131107 diff --git a/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdMonitorIT.java b/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdMonitorIT.java index a4533a674fe70..bb19c9d477a45 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdMonitorIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdMonitorIT.java @@ -13,6 +13,7 @@ import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsResponse; import org.elasticsearch.cluster.DiskUsageIntegTestCase; import org.elasticsearch.cluster.metadata.IndexMetadata; +import org.elasticsearch.cluster.metadata.ProjectId; import org.elasticsearch.cluster.node.DiscoveryNodeRole; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.ShardRoutingState; @@ -86,20 +87,9 @@ public void testFloodStageExceeded() throws Exception { // Verify that we can still move shards around even while blocked final String newDataNodeName = internalCluster().startDataOnlyNode(); final String newDataNodeId = clusterAdmin().prepareNodesInfo(newDataNodeName).get().getNodes().get(0).getNode().getId(); - assertBusy(() -> { - final ShardRouting primaryShard = clusterAdmin().prepareState(TEST_REQUEST_TIMEOUT) - .clear() - .setRoutingTable(true) - .setNodes(true) - .setIndices(indexName) - .get() - .getState() - .routingTable() - .index(indexName) - .shard(0) - .primaryShard(); - assertThat(primaryShard.state(), equalTo(ShardRoutingState.STARTED)); - assertThat(primaryShard.currentNodeId(), equalTo(newDataNodeId)); + awaitClusterState(state -> { + final ShardRouting primaryShard = state.routingTable(ProjectId.DEFAULT).index(indexName).shard(0).primaryShard(); + return primaryShard.state() == ShardRoutingState.STARTED && newDataNodeId.equals(primaryShard.currentNodeId()); }); // Verify that the block is removed once the shard migration is complete