```
org.elasticsearch.ingest.geoip.GeoIpDownloaderIT > testInvalidTimestamp FAILED	
    java.io.UncheckedIOException: java.io.IOException: could not remove the following files (in the order of attempts):	
       /dev/shm/elastic+elasticsearch+pull-request+part-1/modules/ingest-geoip/build/testrun/internalClusterTest/temp/org.elasticsearch.ingest.geoip.GeoIpDownloaderIT_D83FAF86BA4896B5-001/tempDir-002/config/ingest-geoip: java.io.IOException: access denied: /dev/shm/elastic+elasticsearch+pull-request+part-1/modules/ingest-geoip/build/testrun/internalClusterTest/temp/org.elasticsearch.ingest.geoip.GeoIpDownloaderIT_D83FAF86BA4896B5-001/tempDir-002/config/ingest-geoip	
        at org.elasticsearch.ingest.geoip.GeoIpDownloaderIT.lambda$deleteDatabasesInConfigDirectory$30(GeoIpDownloaderIT.java:665)	
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)	
        at java.base/java.util.stream.DistinctOps$1$2.accept(DistinctOps.java:174)	
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)	
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)	
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)	
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)	
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)	
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)	
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)	
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)	
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)	
        at org.elasticsearch.ingest.geoip.GeoIpDownloaderIT.deleteDatabasesInConfigDirectory(GeoIpDownloaderIT.java:661)	
        at org.elasticsearch.ingest.geoip.GeoIpDownloaderIT.cleanUp(GeoIpDownloaderIT.java:108)	
        Caused by:	
        java.io.IOException: could not remove the following files (in the order of attempts):	
           /dev/shm/elastic+elasticsearch+pull-request+part-1/modules/ingest-geoip/build/testrun/internalClusterTest/temp/org.elasticsearch.ingest.geoip.GeoIpDownloaderIT_D83FAF86BA4896B5-001/tempDir-002/config/ingest-geoip: java.io.IOException: access denied: /dev/shm/elastic+elasticsearch+pull-request+part-1/modules/ingest-geoip/build/testrun/internalClusterTest/temp/org.elasticsearch.ingest.geoip.GeoIpDownloaderIT_D83FAF86BA4896B5-001/tempDir-002/config/ingest-geoip	
            at org.elasticsearch.core.IOUtils.rm(IOUtils.java:203)	
            at org.elasticsearch.ingest.geoip.GeoIpDownloaderIT.lambda$deleteDatabasesInConfigDirectory$30(GeoIpDownloaderIT.java:663)	
            ... 13 more	
```

**Build scan:**
https://gradle-enterprise.elastic.co/s/iskz2mnuzdp62/tests/:modules:ingest-geoip:internalClusterTest/org.elasticsearch.ingest.geoip.GeoIpDownloaderIT/testInvalidTimestamp

**Reproduction line:**
```
./gradlew ':modules:ingest-geoip:internalClusterTest' --tests "org.elasticsearch.ingest.geoip.GeoIpDownloaderIT.testInvalidTimestamp" -Dtests.seed=D83FAF86BA4896B5 -Dtests.locale=sr-Latn-BA -Dtests.timezone=America/Santo_Domingo -Druntime.java=20
```

**Applicable branches:**
main

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

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.ingest.geoip.GeoIpDownloaderIT&tests.test=testInvalidTimestamp

**Failure excerpt:**
```
java.io.UncheckedIOException: java.io.IOException: could not remove the following files (in the order of attempts):
   /dev/shm/elastic+elasticsearch+pull-request+part-1/modules/ingest-geoip/build/testrun/internalClusterTest/temp/org.elasticsearch.ingest.geoip.GeoIpDownloaderIT_D83FAF86BA4896B5-001/tempDir-002/config/ingest-geoip: java.io.IOException: access denied: /dev/shm/elastic+elasticsearch+pull-request+part-1/modules/ingest-geoip/build/testrun/internalClusterTest/temp/org.elasticsearch.ingest.geoip.GeoIpDownloaderIT_D83FAF86BA4896B5-001/tempDir-002/config/ingest-geoip

  at org.elasticsearch.ingest.geoip.GeoIpDownloaderIT.lambda$deleteDatabasesInConfigDirectory$30(GeoIpDownloaderIT.java:665)
  at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
  at java.util.stream.DistinctOps$1$2.accept(DistinctOps.java:174)
  at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
  at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
  at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
  at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
  at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
  at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
  at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
  at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
  at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
  at org.elasticsearch.ingest.geoip.GeoIpDownloaderIT.deleteDatabasesInConfigDirectory(GeoIpDownloaderIT.java:661)
  at org.elasticsearch.ingest.geoip.GeoIpDownloaderIT.cleanUp(GeoIpDownloaderIT.java:108)
  at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
  at java.lang.reflect.Method.invoke(Method.java:578)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1758)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:1004)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:48)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at org.apache.lucene.tests.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:45)
  at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
  at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
  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.forkTimeoutingTask(ThreadLeakControl.java:843)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:490)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:955)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:840)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:891)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:902)
  at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
  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.io.IOException: could not remove the following files (in the order of attempts):
     /dev/shm/elastic+elasticsearch+pull-request+part-1/modules/ingest-geoip/build/testrun/internalClusterTest/temp/org.elasticsearch.ingest.geoip.GeoIpDownloaderIT_D83FAF86BA4896B5-001/tempDir-002/config/ingest-geoip: java.io.IOException: access denied: /dev/shm/elastic+elasticsearch+pull-request+part-1/modules/ingest-geoip/build/testrun/internalClusterTest/temp/org.elasticsearch.ingest.geoip.GeoIpDownloaderIT_D83FAF86BA4896B5-001/tempDir-002/config/ingest-geoip

    at org.elasticsearch.core.IOUtils.rm(IOUtils.java:203)
    at org.elasticsearch.ingest.geoip.GeoIpDownloaderIT.lambda$deleteDatabasesInConfigDirectory$30(GeoIpDownloaderIT.java:663)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
    at java.util.stream.DistinctOps$1$2.accept(DistinctOps.java:174)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
    at org.elasticsearch.ingest.geoip.GeoIpDownloaderIT.deleteDatabasesInConfigDirectory(GeoIpDownloaderIT.java:661)
    at org.elasticsearch.ingest.geoip.GeoIpDownloaderIT.cleanUp(GeoIpDownloaderIT.java:108)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.lang.reflect.Method.invoke(Method.java:578)
    at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1758)
    at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:1004)
    at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
    at org.apache.lucene.tests.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:48)
    at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
    at org.apache.lucene.tests.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:45)
    at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
    at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
    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.forkTimeoutingTask(ThreadLeakControl.java:843)
    at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:490)
    at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:955)
    at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:840)
    at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:891)
    at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:902)
    at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
    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)

```
modules/ingest-geoip/src/internalClusterTest/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderIT.java
.map(path -> path.resolve("ingest-geoip"))
            .distinct()
            .forEach(path -> {
                try {
                    IOUtils.rm(path);
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
            });
        assertBusy(() -> {
            GeoIpDownloaderStatsAction.Response response = client().execute(
                GeoIpDownloaderStatsAction.INSTANCE,
                new GeoIpDownloaderStatsAction.Request()
            ).actionGet();
            assertThat(response.getNodes(), not(empty()));
            for (GeoIpDownloaderStatsAction.NodeResponse nodeResponse : response.getNodes()) {
                assertThat(nodeResponse.getConfigDatabases(), empty());
            }
        });
    }
    @SuppressForbidden(reason = "Maxmind API requires java.io.File")
    private void parseDatabase(Path tempFile) throws IOException {
        try (DatabaseReader databaseReader = new DatabaseReader.Builder(tempFile.toFile()).build()) {
            assertNotNull(databaseReader.getMetadata());
        }
    }
    private PersistentTasksCustomMetadata.PersistentTask<PersistentTaskParams> getTask() {
        return PersistentTasksCustomMetadata.getTaskWithId(clusterService().state(), GeoIpDownloader.GEOIP_DOWNLOADER);
    }
    private static class MultiByteArrayInputStream extends InputStream {