The error message:

```
java.nio.file.AccessDeniedException: C:\Users\jenkins\workspace\platform-support\967\x-pack\plugin\searchable-snapshots\build\testrun\internalClusterTest\temp\org.elasticsearch.xpack.searchablesnapshots.cache.shared.NodesCachesStatsIntegTests_66A855EB9B2E60DD-001\tempDir-002\node_s2\shared_snapshot_cache
```

makes this appear related to https://github.com/elastic/elasticsearch/issues/97626

**Build scan:**
https://gradle-enterprise.elastic.co/s/mvpzkmjvxthjw/tests/:x-pack:plugin:searchable-snapshots:internalClusterTest/org.elasticsearch.xpack.searchablesnapshots.cache.shared.NodesCachesStatsIntegTests

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

**Applicable branches:**
main

**Reproduces locally?:**
No

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.xpack.searchablesnapshots.cache.shared.NodesCachesStatsIntegTests&tests.test=classMethod

**Failure excerpt:**
```
java.io.IOException: Could not remove the following files (in the order of attempts):
   C:\Users\jenkins\workspace\platform-support\967\x-pack\plugin\searchable-snapshots\build\testrun\internalClusterTest\temp\org.elasticsearch.xpack.searchablesnapshots.cache.shared.NodesCachesStatsIntegTests_66A855EB9B2E60DD-001\tempDir-002\node_s2\shared_snapshot_cache: java.nio.file.AccessDeniedException: C:\Users\jenkins\workspace\platform-support\967\x-pack\plugin\searchable-snapshots\build\testrun\internalClusterTest\temp\org.elasticsearch.xpack.searchablesnapshots.cache.shared.NodesCachesStatsIntegTests_66A855EB9B2E60DD-001\tempDir-002\node_s2\shared_snapshot_cache
   C:\Users\jenkins\workspace\platform-support\967\x-pack\plugin\searchable-snapshots\build\testrun\internalClusterTest\temp\org.elasticsearch.xpack.searchablesnapshots.cache.shared.NodesCachesStatsIntegTests_66A855EB9B2E60DD-001\tempDir-002\node_s2: java.nio.file.DirectoryNotEmptyException: C:\Users\jenkins\workspace\platform-support\967\x-pack\plugin\searchable-snapshots\build\testrun\internalClusterTest\temp\org.elasticsearch.xpack.searchablesnapshots.cache.shared.NodesCachesStatsIntegTests_66A855EB9B2E60DD-001\tempDir-002\node_s2
   C:\Users\jenkins\workspace\platform-support\967\x-pack\plugin\searchable-snapshots\build\testrun\internalClusterTest\temp\org.elasticsearch.xpack.searchablesnapshots.cache.shared.NodesCachesStatsIntegTests_66A855EB9B2E60DD-001\tempDir-002: java.nio.file.DirectoryNotEmptyException: C:\Users\jenkins\workspace\platform-support\967\x-pack\plugin\searchable-snapshots\build\testrun\internalClusterTest\temp\org.elasticsearch.xpack.searchablesnapshots.cache.shared.NodesCachesStatsIntegTests_66A855EB9B2E60DD-001\tempDir-002
   C:\Users\jenkins\workspace\platform-support\967\x-pack\plugin\searchable-snapshots\build\testrun\internalClusterTest\temp\org.elasticsearch.xpack.searchablesnapshots.cache.shared.NodesCachesStatsIntegTests_66A855EB9B2E60DD-001: java.nio.file.DirectoryNotEmptyException: C:\Users\jenkins\workspace\platform-support\967\x-pack\plugin\searchable-snapshots\build\testrun\internalClusterTest\temp\org.elasticsearch.xpack.searchablesnapshots.cache.shared.NodesCachesStatsIntegTests_66A855EB9B2E60DD-001

  at __randomizedtesting.SeedInfo.seed([66A855EB9B2E60DD]:0)
  at org.apache.lucene.util.IOUtils.rm(IOUtils.java:341)
  at org.apache.lucene.tests.util.TestRuleTemporaryFilesCleanup.afterAlways(TestRuleTemporaryFilesCleanup.java:209)
  at com.carrotsearch.randomizedtesting.rules.TestRuleAdapter$1.afterAlways(TestRuleAdapter.java:31)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:43)
  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)

```
x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/store/input/FrozenIndexInputTests.java
CacheService cacheService,
            FileInfo fileInfo,
            SnapshotId snapshotId,
            byte[] fileData,
            ShardPath shardPath,
            Path cacheDir
        ) {
            super(
                () -> TestUtils.singleBlobContainer(fileInfo.partName(0), fileData),
                () -> new BlobStoreIndexShardSnapshot("_snapshot_id", List.of(fileInfo), 0L, 0L, 0, 0L),
                new TestUtils.SimpleBlobStoreCacheService(),
                "_repository",
                snapshotId,
                new IndexId(SHARD_ID.getIndex().getName(), SHARD_ID.getIndex().getUUID()),
                SHARD_ID,
                Settings.builder()
                    .put(SearchableSnapshotsSettings.SNAPSHOT_PARTIAL_SETTING.getKey(), true)
                    .put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true)
                    .build(),
                System::currentTimeMillis,
                cacheService,
                cacheDir,
                shardPath,
                threadPool,
                service
            );
        }
    }
}