Skip to content

Commit e1c16cf

Browse files
committed
Replace deprecated routingTable table call in tests
1 parent e2ec28d commit e1c16cf

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/plugin/DataNodeRequestSenderIT.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.elasticsearch.action.index.IndexRequest;
1111
import org.elasticsearch.action.support.WriteRequest;
1212
import org.elasticsearch.cluster.metadata.IndexMetadata;
13+
import org.elasticsearch.cluster.project.TestProjectResolvers;
1314
import org.elasticsearch.common.settings.Settings;
1415
import org.elasticsearch.common.util.CollectionUtils;
1516
import org.elasticsearch.compute.operator.exchange.ExchangeService;
@@ -131,12 +132,9 @@ public void testRetryOnShardMovement() {
131132
(handler, request, channel, task) -> {
132133
// move index shard
133134
if (shouldMove.compareAndSet(true, false)) {
134-
var currentShardNodeId = clusterService().state()
135-
.routingTable()
136-
.index("index-1")
137-
.shard(0)
138-
.primaryShard()
139-
.currentNodeId();
135+
var projectState = TestProjectResolvers.DEFAULT_PROJECT_ONLY.getProjectState(clusterService().state());
136+
var shardRouting = projectState.routingTable().shardRoutingTable("index-1", 0);
137+
var currentShardNodeId = shardRouting.primaryShard().currentNodeId();
140138
assertAcked(
141139
client().admin()
142140
.indices()

0 commit comments

Comments
 (0)