**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
new PluginDescriptor("extensible", null, null, null, null, null, null, List.of(), false, false, false, false),
                    extensiblePlugin
                )
            )
        );
        assertThat(extensiblePlugin.extensions, notNullValue());
        assertThat(extensiblePlugin.extensions, hasSize(0));
        extensiblePlugin = new TestExtensiblePlugin();
        TestPlugin testPlugin = new TestPlugin();
        PluginsService.loadExtensions(
            List.of(
                new PluginsService.LoadedPlugin(
                    new PluginDescriptor("extensible", null, null, null, null, null, null, List.of(), false, false, false, false),
                    extensiblePlugin
                ),
                new PluginsService.LoadedPlugin(
                    new PluginDescriptor("test", null, null, null, null, null, null, List.of("extensible"), false, false, false, false),
                    testPlugin
                )
            )
        );
        assertThat(extensiblePlugin.extensions, notNullValue());
        assertThat(extensiblePlugin.extensions, hasSize(2));
        assertThat(extensiblePlugin.extensions.get(0), instanceOf(TestExtension1.class));
        assertThat(extensiblePlugin.extensions.get(1), instanceOf(TestExtension2.class));
        assertThat(((TestExtension2) extensiblePlugin.extensions.get(1)).plugin, sameInstance(testPlugin));
    }
    public void testNoExtensionConstructors() {
        TestPlugin plugin = new TestPlugin();
        class TestExtension implements TestExtensionPoint {