@@ -1366,7 +1366,8 @@ public void testSingleShardStoreFetchUsingBatchAction() throws ExecutionExceptio
1366
1366
DiscoveryNode [] nodes = getDiscoveryNodes ();
1367
1367
TransportNodesListShardStoreMetadataBatch .NodesStoreFilesMetadataBatch response = prepareAndSendRequest (
1368
1368
new String [] { indexName },
1369
- nodes
1369
+ nodes ,
1370
+ false
1370
1371
);
1371
1372
Index index = resolveIndex (indexName );
1372
1373
ShardId shardId = new ShardId (index , 0 );
@@ -1379,12 +1380,14 @@ public void testSingleShardStoreFetchUsingBatchAction() throws ExecutionExceptio
1379
1380
1380
1381
public void testShardStoreFetchMultiNodeMultiIndexesUsingBatchAction () throws Exception {
1381
1382
internalCluster ().startNodes (2 );
1383
+ ensureStableCluster (2 );
1382
1384
String indexName1 = "test1" ;
1383
1385
String indexName2 = "test2" ;
1384
1386
DiscoveryNode [] nodes = getDiscoveryNodes ();
1385
1387
TransportNodesListShardStoreMetadataBatch .NodesStoreFilesMetadataBatch response = prepareAndSendRequest (
1386
1388
new String [] { indexName1 , indexName2 },
1387
- nodes
1389
+ nodes ,
1390
+ true
1388
1391
);
1389
1392
ClusterSearchShardsResponse searchShardsResponse = client ().admin ().cluster ().prepareSearchShards (indexName1 , indexName2 ).get ();
1390
1393
for (ClusterSearchShardsGroup clusterSearchShardsGroup : searchShardsResponse .getGroups ()) {
@@ -1406,7 +1409,8 @@ public void testShardStoreFetchNodeNotConnectedUsingBatchAction() {
1406
1409
String indexName = "test" ;
1407
1410
TransportNodesListShardStoreMetadataBatch .NodesStoreFilesMetadataBatch response = prepareAndSendRequest (
1408
1411
new String [] { indexName },
1409
- new DiscoveryNode [] { nonExistingNode }
1412
+ new DiscoveryNode [] { nonExistingNode },
1413
+ false
1410
1414
);
1411
1415
assertTrue (response .hasFailures ());
1412
1416
assertEquals (1 , response .failures ().size ());
@@ -1513,10 +1517,14 @@ private void prepareIndices(String[] indices, int numberOfPrimaryShards, int num
1513
1517
1514
1518
private TransportNodesListShardStoreMetadataBatch .NodesStoreFilesMetadataBatch prepareAndSendRequest (
1515
1519
String [] indices ,
1516
- DiscoveryNode [] nodes
1520
+ DiscoveryNode [] nodes ,
1521
+ boolean ensureGreen
1517
1522
) {
1518
1523
Map <ShardId , ShardAttributes > shardAttributesMap = null ;
1519
1524
prepareIndices (indices , 1 , 1 );
1525
+ if (ensureGreen ) {
1526
+ ensureGreen (indices );
1527
+ }
1520
1528
shardAttributesMap = prepareRequestMap (indices , 1 );
1521
1529
TransportNodesListShardStoreMetadataBatch .NodesStoreFilesMetadataBatch response ;
1522
1530
return ActionTestUtils .executeBlocking (
0 commit comments