**Build scan:**
https://gradle-enterprise.elastic.co/s/xvwrlxusnxdgu/tests/:qa:rolling-upgrade:v8.6.1%23oneThirdUpgradedTest/org.elasticsearch.upgrades.SnapshotBasedRecoveryIT/testSnapshotBasedRecovery

**Reproduction line:**
```
./gradlew ':qa:rolling-upgrade:v8.6.1#oneThirdUpgradedTest' -Dtests.class="org.elasticsearch.upgrades.SnapshotBasedRecoveryIT" -Dtests.method="testSnapshotBasedRecovery" -Dtests.seed=32151106DB58AD22 -Dtests.bwc=true -Dtests.locale=en-MT -Dtests.timezone=Asia/Colombo -Druntime.java=17
```

**Applicable branches:**
main

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

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.upgrades.SnapshotBasedRecoveryIT&tests.test=testSnapshotBasedRecovery

**Failure excerpt:**
```
java.lang.AssertionError: timed out waiting for green state for index [snapshot_based_recovery] cluster state [{
  "cluster_name" : "v8.6.1",
  "cluster_uuid" : "ETWjuovuQXC6pr6CN8pJXA",
  "version" : 391,
  "state_uuid" : "y7ss0aZLQvab9JIDk7jppg",
  "master_node" : "tsyOGVI1T5iBSTLS0zL29A",
  ...
```
qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/SnapshotBasedRecoveryIT.java
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.util.EntityUtils;
import org.elasticsearch.Version;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;
import org.elasticsearch.cluster.metadata.IndexMetadata;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.support.XContentMapValues;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.repositories.blobstore.BlobStoreRepository;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.xcontent.XContentBuilder;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import static org.elasticsearch.cluster.routing.UnassignedInfo.INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING;
import static org.elasticsearch.cluster.routing.allocation.decider.MaxRetryAllocationDecider.SETTING_ALLOCATION_MAX_RETRY;
import static org.elasticsearch.upgrades.UpgradeWithOldIndexSettingsIT.updateIndexSettingsPermittingSlowlogDeprecationWarning;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.lessThan;
import static org.hamcrest.Matchers.notNullValue;
public class SnapshotBasedRecoveryIT extends AbstractRollingTestCase {