Skip to content

Commit 3dfb4b8

Browse files
committed
Skip some plugins service tests on Windows
These tests need to be skipped. They cause plugins to be loaded which causes a child classloader to be opened. We do not want to add the permissions to be able to close a classloader solely for these tests, and the JARs created in the test can not be deleted on Windows until the classloader is closed. Since this will not happen before test teardown, the test will fail on Windows. So, we skip these tests.
1 parent 8b4a298 commit 3dfb4b8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

server/src/test/java/org/elasticsearch/plugins/PluginsServiceTests.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,11 @@ public FakePlugin() {
671671
}
672672

673673
public void testExistingMandatoryInstalledPlugin() throws IOException {
674+
// This test opens a child classloader, reading a jar under the test temp
675+
// dir (a dummy plugin). Classloaders are closed by GC, so when test teardown
676+
// occurs the jar is deleted while the classloader is still open. However, on
677+
// windows, files cannot be deleted when they are still open by a process.
678+
assumeFalse("windows deletion behavior is asinine", Constants.WINDOWS);
674679
final Path pathHome = createTempDir();
675680
final Path plugins = pathHome.resolve("plugins");
676681
final Path fake = plugins.resolve("fake");
@@ -696,6 +701,11 @@ public void testExistingMandatoryInstalledPlugin() throws IOException {
696701
}
697702

698703
public void testExistingMandatoryMetaPlugin() throws IOException {
704+
// This test opens a child classloader, reading a jar under the test temp
705+
// dir (a dummy plugin). Classloaders are closed by GC, so when test teardown
706+
// occurs the jar is deleted while the classloader is still open. However, on
707+
// windows, files cannot be deleted when they are still open by a process.
708+
assumeFalse("windows deletion behavior is asinine", Constants.WINDOWS);
699709
final Path pathHome = createTempDir();
700710
final Path plugins = pathHome.resolve("plugins");
701711
final Path fakeMeta = plugins.resolve("fake-meta");

0 commit comments

Comments
 (0)