Looks like https://github.com/elastic/elasticsearch/issues/86382 but that should have been fixed in May.

**Build scan:**
https://gradle-enterprise.elastic.co/s/xb7cxwzdk6es6/tests/:libs:elasticsearch-core:test/org.elasticsearch.core.internal.provider.EmbeddedImplClassLoaderTests/classMethod

**Reproduction line:**
`null`

**Applicable branches:**
main

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

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.core.internal.provider.EmbeddedImplClassLoaderTests&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\253\libs\core\build\testrun\test\temp\org.elasticsearch.core.internal.provider.EmbeddedImplClassLoaderTests_E8BB9E0290B7F7A7-001\testResourcesParentNonPkgName-001\parent.jar: java.nio.file.FileSystemException: C:\Users\jenkins\workspace\platform-support\253\libs\core\build\testrun\test\temp\org.elasticsearch.core.internal.provider.EmbeddedImplClassLoaderTests_E8BB9E0290B7F7A7-001\testResourcesParentNonPkgName-001\parent.jar: The process cannot access the file because it is being used by another process
   C:\Users\jenkins\workspace\platform-support\253\libs\core\build\testrun\test\temp\org.elasticsearch.core.internal.provider.EmbeddedImplClassLoaderTests_E8BB9E0290B7F7A7-001\testResourcesParentNonPkgName-001: java.nio.file.DirectoryNotEmptyException: C:\Users\jenkins\workspace\platform-support\253\libs\core\build\testrun\test\temp\org.elasticsearch.core.internal.provider.EmbeddedImplClassLoaderTests_E8BB9E0290B7F7A7-001\testResourcesParentNonPkgName-001
   C:\Users\jenkins\workspace\platform-support\253\libs\core\build\testrun\test\temp\org.elasticsearch.core.internal.provider.EmbeddedImplClassLoaderTests_E8BB9E0290B7F7A7-001\testResourcesParentJavaPkgName-001\parent.jar: java.nio.file.FileSystemException: C:\Users\jenkins\workspace\platform-support\253\libs\core\build\testrun\test\temp\org.elasticsearch.core.internal.provider.EmbeddedImplClassLoaderTests_E8BB9E0290B7F7A7-001\testResourcesParentJavaPkgName-001\parent.jar: The process cannot access the file because it is being used by another process
   C:\Users\jenkins\workspace\platform-support\253\libs\core\build\testrun\test\temp\org.elasticsearch.core.internal.provider.EmbeddedImplClassLoaderTests_E8BB9E0290B7F7A7-001\testResourcesParentJavaPkgName-001: java.nio.file.DirectoryNotEmptyException: C:\Users\jenkins\workspace\platform-support\253\libs\core\build\testrun\test\temp\org.elasticsearch.core.internal.provider.EmbeddedImplClassLoaderTests_E8BB9E0290B7F7A7-001\testResourcesParentJavaPkgName-001
   C:\Users\jenkins\workspace\platform-support\253\libs\core\build\testrun\test\temp\org.elasticsearch.core.internal.provider.EmbeddedImplClassLoaderTests_E8BB9E0290B7F7A7-001: java.nio.file.DirectoryNotEmptyException: C:\Users\jenkins\workspace\platform-support\253\libs\core\build\testrun\test\temp\org.elasticsearch.core.internal.provider.EmbeddedImplClassLoaderTests_E8BB9E0290B7F7A7-001

  at __randomizedtesting.SeedInfo.seed([E8BB9E0290B7F7A7]: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:833)

```
libs/core/src/test/java/org/elasticsearch/core/internal/provider/EmbeddedImplClassLoaderTests.java
static byte[] classBytesForVersion(int version) {
        return InMemoryJavaCompiler.compile("p.FooBar", String.format(Locale.ENGLISH, """
            package p;
            public class FooBar {
                @Override public String toString() {
                    return "FooBar %d";
                }
            }
            """, version));
    }
    /*
     * Instantiates an instance of FooBar. First generates and compiles the code, then packages it,
     * and lastly loads the FooBar class with an embedded loader.
     *
     * @param enableMulti whether to set the multi-release attribute
     * @param versions the runtime version number of the entries to create in the jar
     */
    private Object newFooBar(boolean enableMulti, int... versions) throws Exception {
        String prefix = "IMPL-JARS/x-foo/x-foo-impl.jar/";
        Map<String, byte[]> jarEntries = new HashMap<>();
        jarEntries.put("IMPL-JARS/x-foo/LISTING.TXT", bytes("x-foo-impl.jar"));
        jarEntries.put(prefix + "p/FooBar.class", classBytesForVersion(0)); 
        if (enableMulti) {
            jarEntries.put(prefix + "META-INF/MANIFEST.MF", bytes("Multi-Release: true\n"));
        }
        stream(versions).forEach(v -> jarEntries.put(prefix + "META-INF/versions/" + v + "/p/FooBar.class", classBytesForVersion(v)));
        Path topLevelDir = createTempDir(getTestName());
        Path outerJar = topLevelDir.resolve("impl.jar");
        JarUtils.createJarWithEntries(outerJar, jarEntries);
        URL[] urls = new URL[] { outerJar.toUri().toURL() };