Skip to content

Commit 22d0310

Browse files
committed
Fix test to capture the "search-only" role
1 parent 9db54d5 commit 22d0310

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

x-pack/plugin/downsample/src/test/java/org/elasticsearch/xpack/downsample/DownsampleShardPersistentTaskExecutorTests.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.elasticsearch.cluster.node.DiscoveryNodes;
1919
import org.elasticsearch.cluster.routing.IndexRoutingTable;
2020
import org.elasticsearch.cluster.routing.RoutingTable;
21+
import org.elasticsearch.cluster.routing.ShardRouting;
2122
import org.elasticsearch.common.Strings;
2223
import org.elasticsearch.common.UUIDs;
2324
import org.elasticsearch.common.settings.Settings;
@@ -177,7 +178,11 @@ public void testGetStatelessAssignment() {
177178
.add(
178179
IndexRoutingTable.builder(backingIndex)
179180
.addShard(shardRoutingBuilder(shardId, indexNode.getId(), true, STARTED).withRecoverySource(null).build())
180-
.addShard(shardRoutingBuilder(shardId, searchNode.getId(), false, STARTED).withRecoverySource(null).build())
181+
.addShard(
182+
shardRoutingBuilder(shardId, searchNode.getId(), false, STARTED).withRecoverySource(null)
183+
.withRole(ShardRouting.Role.SEARCH_ONLY)
184+
.build()
185+
)
181186
)
182187
.build()
183188
)

0 commit comments

Comments
 (0)