@@ -152,7 +152,7 @@ public void testUpdateExecutionInfoWithUnavailableClusters() {
152152 executionInfo .swapCluster (REMOTE2_ALIAS , (k , v ) -> new EsqlExecutionInfo .Cluster (REMOTE2_ALIAS , "mylogs1,mylogs2,logs*" , true ));
153153
154154 var failure = new FieldCapabilitiesFailure (new String [] { "logs-a" }, new NoSeedNodeLeftException ("unable to connect" ));
155- var unvailableClusters = Map .of (REMOTE1_ALIAS , failure , REMOTE2_ALIAS , failure );
155+ var unvailableClusters = Map .of (REMOTE1_ALIAS , List . of ( failure ) , REMOTE2_ALIAS , List . of ( failure ) );
156156 EsqlCCSUtils .updateExecutionInfoWithUnavailableClusters (executionInfo , unvailableClusters );
157157
158158 assertThat (executionInfo .clusterAliases (), equalTo (Set .of (LOCAL_CLUSTER_ALIAS , REMOTE1_ALIAS , REMOTE2_ALIAS )));
@@ -184,7 +184,7 @@ public void testUpdateExecutionInfoWithUnavailableClusters() {
184184 var failure = new FieldCapabilitiesFailure (new String [] { "logs-a" }, new NoSeedNodeLeftException ("unable to connect" ));
185185 RemoteTransportException e = expectThrows (
186186 RemoteTransportException .class ,
187- () -> EsqlCCSUtils .updateExecutionInfoWithUnavailableClusters (executionInfo , Map .of (REMOTE2_ALIAS , failure ))
187+ () -> EsqlCCSUtils .updateExecutionInfoWithUnavailableClusters (executionInfo , Map .of (REMOTE2_ALIAS , List . of ( failure ) ))
188188 );
189189 assertThat (e .status ().getStatus (), equalTo (500 ));
190190 assertThat (
@@ -337,8 +337,8 @@ public void testUpdateExecutionInfoWithClustersWithNoMatchingIndices() {
337337 );
338338 // remote1 is unavailable
339339 var failure = new FieldCapabilitiesFailure (new String [] { "logs-a" }, new NoSeedNodeLeftException ("unable to connect" ));
340- var unavailableClusters = Map .of (REMOTE1_ALIAS , List .of (failure ));
341- IndexResolution indexResolution = IndexResolution .valid (esIndex , esIndex .concreteIndices (), unavailableClusters );
340+ var failures = Map .of (REMOTE1_ALIAS , List .of (failure ));
341+ IndexResolution indexResolution = IndexResolution .valid (esIndex , esIndex .concreteIndices (), failures );
342342
343343 EsqlCCSUtils .updateExecutionInfoWithClustersWithNoMatchingIndices (executionInfo , indexResolution );
344344
@@ -348,9 +348,8 @@ public void testUpdateExecutionInfoWithClustersWithNoMatchingIndices() {
348348
349349 EsqlExecutionInfo .Cluster remote1Cluster = executionInfo .getCluster (REMOTE1_ALIAS );
350350 assertThat (remote1Cluster .getIndexExpression (), equalTo ("*" ));
351- // since remote1 is in the unavailable Map (passed to IndexResolution.valid), it's status will not be changed
352- // by updateExecutionInfoWithClustersWithNoMatchingIndices (it is handled in updateExecutionInfoWithUnavailableClusters)
353- assertThat (remote1Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .RUNNING ));
351+ // since remote1 is in the failures Map (passed to IndexResolution.valid),
352+ assertThat (remote1Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
354353
355354 EsqlExecutionInfo .Cluster remote2Cluster = executionInfo .getCluster (REMOTE2_ALIAS );
356355 assertThat (remote2Cluster .getIndexExpression (), equalTo ("mylogs1*,mylogs2*,logs*" ));
@@ -380,18 +379,17 @@ public void testUpdateExecutionInfoWithClustersWithNoMatchingIndices() {
380379 );
381380
382381 var failure = new FieldCapabilitiesFailure (new String [] { "logs-a" }, new NoSeedNodeLeftException ("unable to connect" ));
383- var unavailableClusters = Map .of (REMOTE1_ALIAS , List .of (failure ));
384- IndexResolution indexResolution = IndexResolution .valid (esIndex , esIndex .concreteIndices (), unavailableClusters );
382+ var failures = Map .of (REMOTE1_ALIAS , List .of (failure ));
383+ IndexResolution indexResolution = IndexResolution .valid (esIndex , esIndex .concreteIndices (), failures );
385384 EsqlCCSUtils .updateExecutionInfoWithClustersWithNoMatchingIndices (executionInfo , indexResolution );
386385
387386 EsqlExecutionInfo .Cluster localCluster = executionInfo .getCluster (LOCAL_CLUSTER_ALIAS );
388387 assertThat (localCluster .getIndexExpression (), equalTo ("logs*" ));
389388 assertClusterStatusAndShardCounts (localCluster , EsqlExecutionInfo .Cluster .Status .RUNNING );
390389
391390 EsqlExecutionInfo .Cluster remote1Cluster = executionInfo .getCluster (REMOTE1_ALIAS );
392- // since remote1 is in the unavailable Map (passed to IndexResolution.valid), it's status will not be changed
393- // by updateExecutionInfoWithClustersWithNoMatchingIndices (it is handled in updateExecutionInfoWithUnavailableClusters)
394- assertThat (remote1Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .RUNNING ));
391+ // skipped since remote1 is in the failures Map
392+ assertThat (remote1Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
395393
396394 EsqlExecutionInfo .Cluster remote2Cluster = executionInfo .getCluster (REMOTE2_ALIAS );
397395 assertThat (remote2Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
@@ -429,8 +427,8 @@ public void testUpdateExecutionInfoWithClustersWithNoMatchingIndices() {
429427
430428 // remote1 is unavailable
431429 var failure = new FieldCapabilitiesFailure (new String [] { "logs-a" }, new NoSeedNodeLeftException ("unable to connect" ));
432- var unavailableClusters = Map .of (REMOTE1_ALIAS , List .of (failure ));
433- IndexResolution indexResolution = IndexResolution .valid (esIndex , esIndex .concreteIndices (), unavailableClusters );
430+ var failures = Map .of (REMOTE1_ALIAS , List .of (failure ));
431+ IndexResolution indexResolution = IndexResolution .valid (esIndex , esIndex .concreteIndices (), failures );
434432
435433 EsqlCCSUtils .updateExecutionInfoWithClustersWithNoMatchingIndices (executionInfo , indexResolution );
436434
@@ -440,9 +438,8 @@ public void testUpdateExecutionInfoWithClustersWithNoMatchingIndices() {
440438
441439 EsqlExecutionInfo .Cluster remote1Cluster = executionInfo .getCluster (REMOTE1_ALIAS );
442440 assertThat (remote1Cluster .getIndexExpression (), equalTo ("*" ));
443- // since remote1 is in the unavailable Map (passed to IndexResolution.valid), it's status will not be changed
444- // by updateExecutionInfoWithClustersWithNoMatchingIndices (it is handled in updateExecutionInfoWithUnavailableClusters)
445- assertThat (remote1Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .RUNNING ));
441+ // skipped since remote1 is in the failures Map
442+ assertThat (remote1Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
446443
447444 EsqlExecutionInfo .Cluster remote2Cluster = executionInfo .getCluster (REMOTE2_ALIAS );
448445 assertThat (remote2Cluster .getIndexExpression (), equalTo ("mylogs1*,mylogs2*,logs*" ));
0 commit comments