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
if (rarely()) {
            regionSize = SharedBlobCacheService.SHARED_CACHE_REGION_SIZE_SETTING.get(Settings.EMPTY);
        } else {
            regionSize = ByteSizeValue.ofBytes(randomIntBetween(1, 16) * SharedBytes.PAGE_SIZE);
        }
        final ByteSizeValue cacheSize;
        if (rarely()) {
            cacheSize = regionSize;
        } else {
            cacheSize = ByteSizeValue.ofBytes(randomLongBetween(1L, 10L) * regionSize.getBytes() + randomIntBetween(0, 100));
        }
        final Settings settings = Settings.builder()
            .put(SharedBlobCacheService.SHARED_CACHE_REGION_SIZE_SETTING.getKey(), regionSize)
            .put(SharedBlobCacheService.SHARED_CACHE_RANGE_SIZE_SETTING.getKey(), rangeSize)
            .put(SharedBlobCacheService.SHARED_CACHE_SIZE_SETTING.getKey(), cacheSize)
            .put(SharedBlobCacheService.SHARED_CACHE_MMAP.getKey(), randomBoolean())
            .put("path.home", createTempDir())
            .build();
        final Environment environment = TestEnvironment.newEnvironment(settings);
        for (Path path : environment.dataFiles()) {
            Files.createDirectories(path);
        }
        SnapshotId snapshotId = new SnapshotId("_name", "_uuid");
        final Path shardDir = randomShardPath(SHARD_ID);
        final ShardPath shardPath = new ShardPath(false, shardDir, shardDir, SHARD_ID);
        final Path cacheDir = Files.createDirectories(resolveSnapshotCache(shardDir).resolve(snapshotId.getUUID()));
        try (
            NodeEnvironment nodeEnvironment = new NodeEnvironment(settings, environment);
            SharedBlobCacheService<CacheKey> sharedBlobCacheService = new SharedBlobCacheService<>(
                nodeEnvironment,