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.
This commit is contained in:
Jason Tedor 2018-02-21 13:24:36 -05:00
parent 8b4a298874
commit 3dfb4b8b18
1 changed files with 10 additions and 0 deletions

View File

@ -671,6 +671,11 @@ public class PluginsServiceTests extends ESTestCase {
} }
public void testExistingMandatoryInstalledPlugin() throws IOException { public void testExistingMandatoryInstalledPlugin() throws IOException {
// This test opens a child classloader, reading a jar under the test temp
// dir (a dummy plugin). Classloaders are closed by GC, so when test teardown
// occurs the jar is deleted while the classloader is still open. However, on
// windows, files cannot be deleted when they are still open by a process.
assumeFalse("windows deletion behavior is asinine", Constants.WINDOWS);
final Path pathHome = createTempDir(); final Path pathHome = createTempDir();
final Path plugins = pathHome.resolve("plugins"); final Path plugins = pathHome.resolve("plugins");
final Path fake = plugins.resolve("fake"); final Path fake = plugins.resolve("fake");
@ -696,6 +701,11 @@ public class PluginsServiceTests extends ESTestCase {
} }
public void testExistingMandatoryMetaPlugin() throws IOException { public void testExistingMandatoryMetaPlugin() throws IOException {
// This test opens a child classloader, reading a jar under the test temp
// dir (a dummy plugin). Classloaders are closed by GC, so when test teardown
// occurs the jar is deleted while the classloader is still open. However, on
// windows, files cannot be deleted when they are still open by a process.
assumeFalse("windows deletion behavior is asinine", Constants.WINDOWS);
final Path pathHome = createTempDir(); final Path pathHome = createTempDir();
final Path plugins = pathHome.resolve("plugins"); final Path plugins = pathHome.resolve("plugins");
final Path fakeMeta = plugins.resolve("fake-meta"); final Path fakeMeta = plugins.resolve("fake-meta");