@@ -153,7 +153,7 @@ public void testUpdateExecutionInfoWithUnavailableClusters() {
153153 executionInfo .swapCluster (REMOTE2_ALIAS , (k , v ) -> new EsqlExecutionInfo .Cluster (REMOTE2_ALIAS , "mylogs1,mylogs2,logs*" , true ));
154154
155155 var failure = new FieldCapabilitiesFailure (new String [] { "logs-a" }, new NoSeedNodeLeftException ("unable to connect" ));
156- var unvailableClusters = Map .of (REMOTE1_ALIAS , failure , REMOTE2_ALIAS , failure );
156+ var unvailableClusters = Map .of (REMOTE1_ALIAS , List . of ( failure ) , REMOTE2_ALIAS , List . of ( failure ) );
157157 EsqlCCSUtils .updateExecutionInfoWithUnavailableClusters (executionInfo , unvailableClusters );
158158
159159 assertThat (executionInfo .clusterAliases (), equalTo (Set .of (LOCAL_CLUSTER_ALIAS , REMOTE1_ALIAS , REMOTE2_ALIAS )));
@@ -185,7 +185,7 @@ public void testUpdateExecutionInfoWithUnavailableClusters() {
185185 var failure = new FieldCapabilitiesFailure (new String [] { "logs-a" }, new NoSeedNodeLeftException ("unable to connect" ));
186186 RemoteTransportException e = expectThrows (
187187 RemoteTransportException .class ,
188- () -> EsqlCCSUtils .updateExecutionInfoWithUnavailableClusters (executionInfo , Map .of (REMOTE2_ALIAS , failure ))
188+ () -> EsqlCCSUtils .updateExecutionInfoWithUnavailableClusters (executionInfo , Map .of (REMOTE2_ALIAS , List . of ( failure ) ))
189189 );
190190 assertThat (e .status ().getStatus (), equalTo (500 ));
191191 assertThat (
@@ -338,8 +338,8 @@ public void testUpdateExecutionInfoWithClustersWithNoMatchingIndices() {
338338 );
339339 // remote1 is unavailable
340340 var failure = new FieldCapabilitiesFailure (new String [] { "logs-a" }, new NoSeedNodeLeftException ("unable to connect" ));
341- var unavailableClusters = Map .of (REMOTE1_ALIAS , List .of (failure ));
342- IndexResolution indexResolution = IndexResolution .valid (esIndex , esIndex .concreteIndices (), unavailableClusters );
341+ var failures = Map .of (REMOTE1_ALIAS , List .of (failure ));
342+ IndexResolution indexResolution = IndexResolution .valid (esIndex , esIndex .concreteIndices (), failures );
343343
344344 EsqlCCSUtils .updateExecutionInfoWithClustersWithNoMatchingIndices (executionInfo , indexResolution );
345345
@@ -349,9 +349,8 @@ public void testUpdateExecutionInfoWithClustersWithNoMatchingIndices() {
349349
350350 EsqlExecutionInfo .Cluster remote1Cluster = executionInfo .getCluster (REMOTE1_ALIAS );
351351 assertThat (remote1Cluster .getIndexExpression (), equalTo ("*" ));
352- // since remote1 is in the unavailable Map (passed to IndexResolution.valid), it's status will not be changed
353- // by updateExecutionInfoWithClustersWithNoMatchingIndices (it is handled in updateExecutionInfoWithUnavailableClusters)
354- assertThat (remote1Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .RUNNING ));
352+ // since remote1 is in the failures Map (passed to IndexResolution.valid),
353+ assertThat (remote1Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
355354
356355 EsqlExecutionInfo .Cluster remote2Cluster = executionInfo .getCluster (REMOTE2_ALIAS );
357356 assertThat (remote2Cluster .getIndexExpression (), equalTo ("mylogs1*,mylogs2*,logs*" ));
@@ -381,18 +380,17 @@ public void testUpdateExecutionInfoWithClustersWithNoMatchingIndices() {
381380 );
382381
383382 var failure = new FieldCapabilitiesFailure (new String [] { "logs-a" }, new NoSeedNodeLeftException ("unable to connect" ));
384- var unavailableClusters = Map .of (REMOTE1_ALIAS , List .of (failure ));
385- IndexResolution indexResolution = IndexResolution .valid (esIndex , esIndex .concreteIndices (), unavailableClusters );
383+ var failures = Map .of (REMOTE1_ALIAS , List .of (failure ));
384+ IndexResolution indexResolution = IndexResolution .valid (esIndex , esIndex .concreteIndices (), failures );
386385 EsqlCCSUtils .updateExecutionInfoWithClustersWithNoMatchingIndices (executionInfo , indexResolution );
387386
388387 EsqlExecutionInfo .Cluster localCluster = executionInfo .getCluster (LOCAL_CLUSTER_ALIAS );
389388 assertThat (localCluster .getIndexExpression (), equalTo ("logs*" ));
390389 assertClusterStatusAndShardCounts (localCluster , EsqlExecutionInfo .Cluster .Status .RUNNING );
391390
392391 EsqlExecutionInfo .Cluster remote1Cluster = executionInfo .getCluster (REMOTE1_ALIAS );
393- // since remote1 is in the unavailable Map (passed to IndexResolution.valid), it's status will not be changed
394- // by updateExecutionInfoWithClustersWithNoMatchingIndices (it is handled in updateExecutionInfoWithUnavailableClusters)
395- assertThat (remote1Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .RUNNING ));
392+ // skipped since remote1 is in the failures Map
393+ assertThat (remote1Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
396394
397395 EsqlExecutionInfo .Cluster remote2Cluster = executionInfo .getCluster (REMOTE2_ALIAS );
398396 assertThat (remote2Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
@@ -430,8 +428,8 @@ public void testUpdateExecutionInfoWithClustersWithNoMatchingIndices() {
430428
431429 // remote1 is unavailable
432430 var failure = new FieldCapabilitiesFailure (new String [] { "logs-a" }, new NoSeedNodeLeftException ("unable to connect" ));
433- var unavailableClusters = Map .of (REMOTE1_ALIAS , List .of (failure ));
434- IndexResolution indexResolution = IndexResolution .valid (esIndex , esIndex .concreteIndices (), unavailableClusters );
431+ var failures = Map .of (REMOTE1_ALIAS , List .of (failure ));
432+ IndexResolution indexResolution = IndexResolution .valid (esIndex , esIndex .concreteIndices (), failures );
435433
436434 EsqlCCSUtils .updateExecutionInfoWithClustersWithNoMatchingIndices (executionInfo , indexResolution );
437435
@@ -441,9 +439,8 @@ public void testUpdateExecutionInfoWithClustersWithNoMatchingIndices() {
441439
442440 EsqlExecutionInfo .Cluster remote1Cluster = executionInfo .getCluster (REMOTE1_ALIAS );
443441 assertThat (remote1Cluster .getIndexExpression (), equalTo ("*" ));
444- // since remote1 is in the unavailable Map (passed to IndexResolution.valid), it's status will not be changed
445- // by updateExecutionInfoWithClustersWithNoMatchingIndices (it is handled in updateExecutionInfoWithUnavailableClusters)
446- assertThat (remote1Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .RUNNING ));
442+ // skipped since remote1 is in the failures Map
443+ assertThat (remote1Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
447444
448445 EsqlExecutionInfo .Cluster remote2Cluster = executionInfo .getCluster (REMOTE2_ALIAS );
449446 assertThat (remote2Cluster .getIndexExpression (), equalTo ("mylogs1*,mylogs2*,logs*" ));
0 commit comments