From be5da2815dc1a64a60643c6286ff601ebf0c3cba Mon Sep 17 00:00:00 2001 From: Tim Brooks Date: Thu, 4 Jan 2018 09:55:51 -0700 Subject: [PATCH] Set the elasticsearch-nio codebase for tests (#28067) This commit sets the elasticsearch-nio code base in the BootstrapForTesting class. This is necessary as that codebase needs socket permissions. Setting the codebase manually is necessary as intellij does not package our internal libraries when running tests. --- .../java/org/elasticsearch/bootstrap/BootstrapForTesting.java | 1 + .../src/main/java/org/elasticsearch/test/ESTestCase.java | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/test/framework/src/main/java/org/elasticsearch/bootstrap/BootstrapForTesting.java b/test/framework/src/main/java/org/elasticsearch/bootstrap/BootstrapForTesting.java index c3d59b7590b..3939b47fd22 100644 --- a/test/framework/src/main/java/org/elasticsearch/bootstrap/BootstrapForTesting.java +++ b/test/framework/src/main/java/org/elasticsearch/bootstrap/BootstrapForTesting.java @@ -135,6 +135,7 @@ public class BootstrapForTesting { if (System.getProperty("tests.gradle") == null) { // intellij and eclipse don't package our internal libs, so we need to set the codebases for them manually addClassCodebase(codebases,"plugin-classloader", "org.elasticsearch.plugins.ExtendedPluginsClassLoader"); + addClassCodebase(codebases,"elasticsearch-nio", "org.elasticsearch.nio.ChannelFactory"); } final Policy testFramework = Security.readPolicy(Bootstrap.class.getResource("test-framework.policy"), codebases); final Policy esPolicy = new ESPolicy(codebases, perms, getPluginPermissions(), true); diff --git a/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java index 0d341d5db3d..0d185a0ff4c 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java @@ -896,9 +896,7 @@ public abstract class ESTestCase extends LuceneTestCase { @BeforeClass public static void setUseNio() throws Exception { -// useNio = randomBoolean(); - // TODO: Temporarily disable nio as it does not work with intellij testrunner - useNio = false; + useNio = randomBoolean(); } public static String getTestTransportType() {