**Build scan:**
https://gradle-enterprise.elastic.co/s/3wwnehg5i63ow/tests/:x-pack:plugin:security:qa:multi-cluster:javaRestTest/org.elasticsearch.xpack.remotecluster.RemoteClusterSecurityRestIT

**Reproduction line:**
```
null
```

**Applicable branches:**
main

**Reproduces locally?:**
Didn't try

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.xpack.remotecluster.RemoteClusterSecurityRestIT&tests.test=classMethod

**Failure excerpt:**
```
java.lang.RuntimeException: An error occurred orchestrating test cluster.

  at __randomizedtesting.SeedInfo.seed([8D2E6C76D2C38EC3]:0)
  at org.elasticsearch.test.cluster.local.LocalClusterHandle.execute(LocalClusterHandle.java:236)
  at org.elasticsearch.test.cluster.local.LocalClusterHandle.execute(LocalClusterHandle.java:241)
  at org.elasticsearch.test.cluster.local.LocalClusterHandle.start(LocalClusterHandle.java:68)
  at org.elasticsearch.test.cluster.local.LocalElasticsearchCluster$1.evaluate(LocalElasticsearchCluster.java:38)
  at org.elasticsearch.test.cluster.local.LocalElasticsearchCluster$1.evaluate(LocalElasticsearchCluster.java:39)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)
  at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
  at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
  at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
  at org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.lambda$forkTimeoutingTask$0(ThreadLeakControl.java:850)
  at java.lang.Thread.run(Thread.java:1623)

  Caused by: java.util.concurrent.CancellationException: Request execution cancelled

    at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.execute(CloseableHttpAsyncClientBase.java:114)
    at org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:138)
    at org.elasticsearch.client.RestClient.performRequest(RestClient.java:296)
    at org.elasticsearch.client.RestClient.performRequest(RestClient.java:288)
    at org.elasticsearch.xpack.remotecluster.AbstractRemoteClusterSecurityTestCase.performRequestAgainstFulfillingCluster(AbstractRemoteClusterSecurityTestCase.java:173)
    at org.elasticsearch.xpack.remotecluster.AbstractRemoteClusterSecurityTestCase.createCrossClusterAccessApiKey(AbstractRemoteClusterSecurityTestCase.java:127)
    at org.elasticsearch.xpack.remotecluster.RemoteClusterSecurityRestIT.lambda$static$0(RemoteClusterSecurityRestIT.java:69)
    at org.elasticsearch.test.cluster.local.AbstractLocalSpecBuilder.lambda$keystore$12(AbstractLocalSpecBuilder.java:165)
    at org.elasticsearch.test.cluster.local.LocalClusterSpec$LocalNodeSpec.lambda$resolveKeystore$1(LocalClusterSpec.java:244)
    at java.lang.Iterable.forEach(Iterable.java:75)
    at org.elasticsearch.test.cluster.local.LocalClusterSpec$LocalNodeSpec.resolveKeystore(LocalClusterSpec.java:244)
    at org.elasticsearch.test.cluster.local.LocalClusterSpec$LocalNodeSpec.getSetting(LocalClusterSpec.java:208)
    at org.elasticsearch.test.cluster.local.LocalClusterSpec$LocalNodeSpec.isMasterEligible(LocalClusterSpec.java:194)
    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178)
    at java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:722)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
    at org.elasticsearch.test.cluster.local.DefaultSettingsProvider.get(DefaultSettingsProvider.java:73)
    at org.elasticsearch.test.cluster.local.LocalClusterSpec$LocalNodeSpec.lambda$resolveSettings$0(LocalClusterSpec.java:226)
    at java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.elasticsearch.test.cluster.local.LocalClusterSpec$LocalNodeSpec.resolveSettings(LocalClusterSpec.java:226)
    at org.elasticsearch.test.cluster.local.LocalClusterFactory$Node.writeConfiguration(LocalClusterFactory.java:331)
    at org.elasticsearch.test.cluster.local.LocalClusterFactory$Node.start(LocalClusterFactory.java:139)
    at org.elasticsearch.test.cluster.local.LocalClusterHandle.lambda$start$0(LocalClusterHandle.java:68)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
    at java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:722)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
    at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:290)
    at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:754)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
    at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:667)
    at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:159)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:173)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
    at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:765)
    at org.elasticsearch.test.cluster.local.LocalClusterHandle.lambda$start$1(LocalClusterHandle.java:68)
    at org.elasticsearch.test.cluster.local.LocalClusterHandle.lambda$execute$14(LocalClusterHandle.java:242)
    at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1456)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
    at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
    at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)

```
x-pack/plugin/security/qa/multi-cluster/src/javaRestTest/java/org/elasticsearch/xpack/remotecluster/AbstractRemoteClusterSecurityWithMultipleRemotesRestIT.java
);
            
            final boolean searchFirstCluster = randomBoolean();
            final String index1 = searchFirstCluster ? "cluster1_index1" : "cluster2_index1";
            searchAndAssertIndicesFound(
                String.format(
                    Locale.ROOT,
                    "/%s:%s/_search?ccs_minimize_roundtrips=%s",
                    searchFirstCluster ? "my_remote_cluster" : "my_remote_cluster_2",
                    randomFrom(index1, "*_index1", "*"),
                    randomBoolean()
                ),
                index1
            );
            
            
            
            final boolean skipUnavailableOnOtherCluster = isSkipUnavailable("my_remote_cluster_2");
            
            
            final String missingIndex = "missingIndex";
            final boolean missingIndexOnFirstCluster = randomBoolean();
            
            final boolean missingIndexOnSecondCluster = false == missingIndexOnFirstCluster || randomBoolean();
            final String searchPath1 = String.format(
                Locale.ROOT,
                "/my_remote_cluster:%s,my_remote_cluster_2:%s/_search?ccs_minimize_roundtrips=%s",
                missingIndexOnFirstCluster ? missingIndex : randomFrom("cluster1_index1", "*_index1", "*"),
                missingIndexOnSecondCluster ? missingIndex : randomFrom("cluster2_index1", "*_index1", "*"),
                randomBoolean()