Skip to content

Commit be5da28

Browse files
authored
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.
1 parent 47a506d commit be5da28

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

test/framework/src/main/java/org/elasticsearch/bootstrap/BootstrapForTesting.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ public class BootstrapForTesting {
135135
if (System.getProperty("tests.gradle") == null) {
136136
// intellij and eclipse don't package our internal libs, so we need to set the codebases for them manually
137137
addClassCodebase(codebases,"plugin-classloader", "org.elasticsearch.plugins.ExtendedPluginsClassLoader");
138+
addClassCodebase(codebases,"elasticsearch-nio", "org.elasticsearch.nio.ChannelFactory");
138139
}
139140
final Policy testFramework = Security.readPolicy(Bootstrap.class.getResource("test-framework.policy"), codebases);
140141
final Policy esPolicy = new ESPolicy(codebases, perms, getPluginPermissions(), true);

test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -896,9 +896,7 @@ public static String randomGeohash(int minPrecision, int maxPrecision) {
896896

897897
@BeforeClass
898898
public static void setUseNio() throws Exception {
899-
// useNio = randomBoolean();
900-
// TODO: Temporarily disable nio as it does not work with intellij testrunner
901-
useNio = false;
899+
useNio = randomBoolean();
902900
}
903901

904902
public static String getTestTransportType() {

0 commit comments

Comments
 (0)