From ec34163b014dd2fdb09a85460b1a74f523c087dc Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Wed, 30 Mar 2016 08:54:43 +0200 Subject: [PATCH] Marvel integ test should stop and start exporters between tests. The ongoing activity messes with ESIntegTest level clean ups Original commit: elastic/x-pack-elasticsearch@474ed7080a680882cd92ce63706afc8298d7359b --- .../elasticsearch/marvel/MarvelPluginTests.java | 12 ++++++++++++ .../agent/exporter/http/HttpExporterTests.java | 1 - .../marvel/test/MarvelIntegTestCase.java | 14 ++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MarvelPluginTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MarvelPluginTests.java index 99ab9879cdf..a0fb6d3a4b2 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MarvelPluginTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MarvelPluginTests.java @@ -19,6 +19,18 @@ import static org.hamcrest.Matchers.equalTo; @ClusterScope(scope = TEST, transportClientRatio = 0, numClientNodes = 0, numDataNodes = 0) public class MarvelPluginTests extends MarvelIntegTestCase { + + + @Override + protected void startCollection() { + // do nothing as marvel is sometime unbound + } + + @Override + protected void stopCollection() { + // do nothing as marvel is sometime unbound + } + @Override protected Settings nodeSettings(int nodeOrdinal) { return Settings.builder() diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTests.java index 0ece35ae523..e975df6336b 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTests.java @@ -84,7 +84,6 @@ public class HttpExporterTests extends MarvelIntegTestCase { @After public void cleanup() throws Exception { - stopCollection(); webServer.shutdown(); } diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/test/MarvelIntegTestCase.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/test/MarvelIntegTestCase.java index b6a3f76250a..71edac0f604 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/test/MarvelIntegTestCase.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/test/MarvelIntegTestCase.java @@ -39,6 +39,8 @@ import org.elasticsearch.xpack.XPackClient; import org.elasticsearch.xpack.XPackPlugin; import org.hamcrest.Matcher; import org.jboss.netty.util.internal.SystemPropertyUtil; +import org.junit.After; +import org.junit.Before; import java.io.BufferedWriter; import java.io.IOException; @@ -166,6 +168,18 @@ public abstract class MarvelIntegTestCase extends ESIntegTestCase { return templates; } + @Before + public void setUp() throws Exception { + super.setUp(); + startCollection(); + } + + @After + public void tearDown() throws Exception { + stopCollection(); + super.tearDown(); + } + /** * Override and return {@code false} to force running without Security. */