From c463083537d7c9e2058fc3b342a6c113720ef0b2 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Tue, 12 Jul 2016 17:55:05 +0200 Subject: [PATCH] minor cleanups and an additional BogusPlugin for HttpSmokeTestCase --- .../index/reindex/RetryTests.java | 2 +- .../smoketest/ESSmokeClientTestCase.java | 2 +- .../elasticsearch/http/HttpSmokeTestCase.java | 21 +++++++++++++++++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/RetryTests.java b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/RetryTests.java index 51d951bbb5e..4b23a525e50 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/RetryTests.java +++ b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/RetryTests.java @@ -66,7 +66,7 @@ public class RetryTests extends ESSingleNodeTestCase { } public static final class BogusPlugin extends Plugin { - // se NettyUtils.... this runs without the permission from the netty module so it will fail since reindex can't set the property + // se NettyPlugin.... this runs without the permission from the netty module so it will fail since reindex can't set the property // to make it still work we disable that check but need to register the setting first private static final Setting ASSERT_NETTY_BUGLEVEL = Setting.boolSetting("netty.assert.buglevel", true, Setting.Property.NodeScope); diff --git a/qa/smoke-test-client/src/test/java/org/elasticsearch/smoketest/ESSmokeClientTestCase.java b/qa/smoke-test-client/src/test/java/org/elasticsearch/smoketest/ESSmokeClientTestCase.java index 0c1299da571..f037ad7142e 100644 --- a/qa/smoke-test-client/src/test/java/org/elasticsearch/smoketest/ESSmokeClientTestCase.java +++ b/qa/smoke-test-client/src/test/java/org/elasticsearch/smoketest/ESSmokeClientTestCase.java @@ -81,7 +81,7 @@ public abstract class ESSmokeClientTestCase extends LuceneTestCase { protected String index; public static final class BogusPlugin extends Plugin { - // se NettyUtils.... this runs without the permission from the netty module so it will fail since reindex can't set the property + // se NettyPlugin.... this runs without the permission from the netty module so it will fail since reindex can't set the property // to make it still work we disable that check but need to register the setting first private static final Setting ASSERT_NETTY_BUGLEVEL = Setting.boolSetting("netty.assert.buglevel", true, Setting.Property.NodeScope); diff --git a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/HttpSmokeTestCase.java b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/HttpSmokeTestCase.java index b2ebc63f120..ac420c9b56a 100644 --- a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/HttpSmokeTestCase.java +++ b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/HttpSmokeTestCase.java @@ -19,6 +19,7 @@ package org.elasticsearch.http; import org.elasticsearch.common.network.NetworkModule; +import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; @@ -27,6 +28,8 @@ import org.elasticsearch.transport.MockTcpTransportPlugin; import org.elasticsearch.transport.NettyPlugin; import java.util.Collection; +import java.util.Collections; +import java.util.List; public abstract class HttpSmokeTestCase extends ESIntegTestCase { @@ -34,6 +37,7 @@ public abstract class HttpSmokeTestCase extends ESIntegTestCase { protected Settings nodeSettings(int nodeOrdinal) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) + .put("netty.assert.buglevel", false) .put(NetworkModule.TRANSPORT_TYPE_KEY, randomFrom(NettyPlugin.NETTY_TRANSPORT_NAME, MockTcpTransportPlugin.MOCK_TCP_TRANSPORT_NAME)) .put(NetworkModule.HTTP_ENABLED.getKey(), true).build(); @@ -41,18 +45,19 @@ public abstract class HttpSmokeTestCase extends ESIntegTestCase { @Override protected Collection> nodePlugins() { - return pluginList(MockTcpTransportPlugin.class, NettyPlugin.class); + return pluginList(MockTcpTransportPlugin.class, NettyPlugin.class, BogusPlugin.class); } @Override protected Collection> transportClientPlugins() { - return pluginList(MockTcpTransportPlugin.class, NettyPlugin.class); + return pluginList(MockTcpTransportPlugin.class, NettyPlugin.class, BogusPlugin.class); } @Override protected Settings transportClientSettings() { return Settings.builder() .put(super.transportClientSettings()) + .put("netty.assert.buglevel", false) .put(NetworkModule.TRANSPORT_TYPE_KEY, randomFrom(NettyPlugin.NETTY_TRANSPORT_NAME, MockTcpTransportPlugin.MOCK_TCP_TRANSPORT_NAME)).build(); } @@ -61,4 +66,16 @@ public abstract class HttpSmokeTestCase extends ESIntegTestCase { protected boolean ignoreExternalCluster() { return true; } + + + public static final class BogusPlugin extends Plugin { + // see NettyPlugin.... this runs without the permission from the netty module so it will fail since reindex can't set the property + // to make it still work we disable that check but need to register the setting first + private static final Setting ASSERT_NETTY_BUGLEVEL = Setting.boolSetting("netty.assert.buglevel", true, + Setting.Property.NodeScope); + @Override + public List> getSettings() { + return Collections.singletonList(ASSERT_NETTY_BUGLEVEL); + } + } }