Maybe related to: https://github.com/elastic/elasticsearch/issues/92936

**Build scan:**
https://gradle-enterprise.elastic.co/s/xnay2gtnbk67u/tests/:libs:elasticsearch-plugin-scanner:test/org.elasticsearch.plugin.scanner.ClassReadersTests

**Reproduction line:**
```
./gradlew ':libs:elasticsearch-plugin-scanner:test' --tests "org.elasticsearch.plugin.scanner.ClassReadersTests" -Dtests.seed=62A93F3353484C1B -Dtests.locale=en-US -Dtests.timezone=Atlantic/Reykjavik -Druntime.java=19
```

**Applicable branches:**
8.6, main

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

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.plugin.scanner.ClassReadersTests&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\125\libs\plugin-scanner\build\testrun\test\temp\org.elasticsearch.plugin.scanner.ClassReadersTests_62A93F3353484C1B-001\tempDir-003: java.nio.file.DirectoryNotEmptyException: C:\Users\jenkins\workspace\platform-support\125\libs\plugin-scanner\build\testrun\test\temp\org.elasticsearch.plugin.scanner.ClassReadersTests_62A93F3353484C1B-001\tempDir-003
   C:\Users\jenkins\workspace\platform-support\125\libs\plugin-scanner\build\testrun\test\temp\org.elasticsearch.plugin.scanner.ClassReadersTests_62A93F3353484C1B-001\tempDir-003\jars-dir: java.nio.file.AccessDeniedException: C:\Users\jenkins\workspace\platform-support\125\libs\plugin-scanner\build\testrun\test\temp\org.elasticsearch.plugin.scanner.ClassReadersTests_62A93F3353484C1B-001\tempDir-003\jars-dir
   C:\Users\jenkins\workspace\platform-support\125\libs\plugin-scanner\build\testrun\test\temp\org.elasticsearch.plugin.scanner.ClassReadersTests_62A93F3353484C1B-001: java.nio.file.DirectoryNotEmptyException: C:\Users\jenkins\workspace\platform-support\125\libs\plugin-scanner\build\testrun\test\temp\org.elasticsearch.plugin.scanner.ClassReadersTests_62A93F3353484C1B-001

  at __randomizedtesting.SeedInfo.seed([62A93F3353484C1B]: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:1589)

```
libs/plugin-scanner/src/test/java/org/elasticsearch/plugin/scanner/ClassReadersTests.java
List<ClassReader> classReaders = ClassReaders.ofPaths(Stream.of(tmp, jar, jar2));
        List<String> collect = classReaders.stream().map(cr -> cr.getClassName()).collect(Collectors.toList());
        org.hamcrest.MatcherAssert.assertThat(collect, Matchers.containsInAnyOrder("p/A", "p/B", "p/C", "p/D", "p/E"));
    }
    public void testMultipleJarsInADir() throws IOException {
        final Path tmp = tmpDir();
        final Path dirWithJar = tmp.resolve("jars-dir");
        Files.createDirectories(dirWithJar);
        Path jar = dirWithJar.resolve("a_b.jar");
        JarUtils.createJarWithEntries(jar, Map.of("p/A.class", InMemoryJavaCompiler.compile("p.A", """
            package p;
            public class A {}
            """), "p/B.class", InMemoryJavaCompiler.compile("p.B", """
            package p;
            public class B {}
            """)));
        Path jar2 = dirWithJar.resolve("c_d.jar");
        JarUtils.createJarWithEntries(jar2, Map.of("p/C.class", InMemoryJavaCompiler.compile("p.C", """
            package p;
            public class C {}
            """), "p/D.class", InMemoryJavaCompiler.compile("p.D", """
            package p;
            public class D {}
            """)));
        List<ClassReader> classReaders = ClassReaders.ofDirWithJars(dirWithJar.toString());
        List<String> collect = classReaders.stream().map(cr -> cr.getClassName()).collect(Collectors.toList());
        org.hamcrest.MatcherAssert.assertThat(collect, Matchers.containsInAnyOrder("p/A", "p/B", "p/C", "p/D"));
    }
}