**Build scan:**
https://gradle-enterprise.elastic.co/s/jfq4w6bzdfc44/tests/:server:test/org.elasticsearch.plugins.PluginsServiceTests/classMethod

**Reproduction line:**
`null`

**Applicable branches:**
master

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

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.plugins.PluginsServiceTests&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\211\server\build\testrun\test\temp\org.elasticsearch.plugins.PluginsServiceTests_D6E9C143DF9FF0A4-001\testLoadServiceProviders-002\custom_plugin_string.jar: java.nio.file.FileSystemException: C:\Users\jenkins\workspace\platform-support\211\server\build\testrun\test\temp\org.elasticsearch.plugins.PluginsServiceTests_D6E9C143DF9FF0A4-001\testLoadServiceProviders-002\custom_plugin_string.jar: The process cannot access the file because it is being used by another process
   C:\Users\jenkins\workspace\platform-support\211\server\build\testrun\test\temp\org.elasticsearch.plugins.PluginsServiceTests_D6E9C143DF9FF0A4-001\testLoadServiceProviders-002: java.nio.file.DirectoryNotEmptyException: C:\Users\jenkins\workspace\platform-support\211\server\build\testrun\test\temp\org.elasticsearch.plugins.PluginsServiceTests_D6E9C143DF9FF0A4-001\testLoadServiceProviders-002
   C:\Users\jenkins\workspace\platform-support\211\server\build\testrun\test\temp\org.elasticsearch.plugins.PluginsServiceTests_D6E9C143DF9FF0A4-001\testLoadServiceProviders-001\custom_plugin_integer.jar: java.nio.file.FileSystemException: C:\Users\jenkins\workspace\platform-support\211\server\build\testrun\test\temp\org.elasticsearch.plugins.PluginsServiceTests_D6E9C143DF9FF0A4-001\testLoadServiceProviders-001\custom_plugin_integer.jar: The process cannot access the file because it is being used by another process
   C:\Users\jenkins\workspace\platform-support\211\server\build\testrun\test\temp\org.elasticsearch.plugins.PluginsServiceTests_D6E9C143DF9FF0A4-001\testLoadServiceProviders-001: java.nio.file.DirectoryNotEmptyException: C:\Users\jenkins\workspace\platform-support\211\server\build\testrun\test\temp\org.elasticsearch.plugins.PluginsServiceTests_D6E9C143DF9FF0A4-001\testLoadServiceProviders-001
   C:\Users\jenkins\workspace\platform-support\211\server\build\testrun\test\temp\org.elasticsearch.plugins.PluginsServiceTests_D6E9C143DF9FF0A4-001: java.nio.file.DirectoryNotEmptyException: C:\Users\jenkins\workspace\platform-support\211\server\build\testrun\test\temp\org.elasticsearch.plugins.PluginsServiceTests_D6E9C143DF9FF0A4-001

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

```
server/src/test/java/org/elasticsearch/plugins/PluginsServiceTests.java
import org.elasticsearch.plugin.analysis.api.CharFilterFactory;
            import org.elasticsearch.plugin.api.NamedComponent;
            import java.io.Reader;
            @NamedComponent( "a_name")
            public class A  implements CharFilterFactory {
                 @Override
                public Reader create(Reader reader) {
                    return reader;
                }
            }
            """)));
        Path namedComponentFile = plugin.resolve("named_components.json");
        Files.writeString(namedComponentFile, """
            {
              "org.elasticsearch.plugin.analysis.api.CharFilterFactory": {
                "a_name": "p.A"
              }
            }
            """);
        var pluginService = newPluginsService(settings);
        try {
            Map<String, Plugin> stringPluginMap = pluginService.pluginMap();
            assertThat(stringPluginMap.get("stable-plugin"), instanceOf(StablePluginPlaceHolder.class));
            PluginsAndModules info = pluginService.info();
            List<PluginRuntimeInfo> pluginInfos = info.getPluginInfos();
            assertEquals(pluginInfos.size(), 1);
            assertThat(pluginInfos.get(0).descriptor().getName(), equalTo("stable-plugin"));
            assertThat(pluginInfos.get(0).descriptor().isStable(), is(true));
            
            Collection<PluginInfo> stablePluginInfos = pluginService.getStablePluginRegistry()