diff --git a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/bench/HasherBenchmark.java b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/bench/HasherBenchmark.java index 13940993f5f..3400aba7d1f 100644 --- a/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/bench/HasherBenchmark.java +++ b/elasticsearch/x-pack/shield/src/test/java/org/elasticsearch/bench/HasherBenchmark.java @@ -8,11 +8,13 @@ package org.elasticsearch.bench; import org.elasticsearch.common.Randomness; import com.carrotsearch.randomizedtesting.generators.RandomStrings; +import org.elasticsearch.common.SuppressForbidden; import org.elasticsearch.common.metrics.MeanMetric; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.shield.authc.support.Hasher; import org.elasticsearch.shield.authc.support.SecuredString; +@SuppressForbidden(reason = "benchmark") public class HasherBenchmark { private static final int WARMING_ITERS = 1000; @@ -63,6 +65,7 @@ public class HasherBenchmark { return metrics; } + @SuppressForbidden(reason = "benchmark") private static class Metrics { final String name; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/support/EmailServer.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/support/EmailServer.java index 141dfd8f09f..f8379a6ec31 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/support/EmailServer.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/support/EmailServer.java @@ -42,7 +42,7 @@ public class EmailServer { private final SMTPServer server; - public EmailServer(String host, int port, final String username, final String password) { + public EmailServer(String host, int port, final String username, final String password, final ESLogger logger) { server = new SMTPServer(new SimpleMessageListenerAdapter(new SimpleMessageListener() { @Override public boolean accept(String from, String recipient) { @@ -58,8 +58,8 @@ public class EmailServer { try { listener.on(msg); } catch (Exception e) { + logger.error("Unexpected failure", e); fail(e.getMessage()); - e.printStackTrace(); } } } catch (MessagingException me) { @@ -104,7 +104,7 @@ public class EmailServer { @Override public boolean onPortNumber(int port) { try { - EmailServer server = new EmailServer("localhost", port, username, password); + EmailServer server = new EmailServer("localhost", port, username, password, logger); server.start(); emailServer.set(server); return true; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/bench/ScheduleEngineTriggerBenchmark.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/bench/ScheduleEngineTriggerBenchmark.java index 669d97d0c7f..45119805a49 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/bench/ScheduleEngineTriggerBenchmark.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/bench/ScheduleEngineTriggerBenchmark.java @@ -6,6 +6,7 @@ package org.elasticsearch.watcher.test.bench; import org.elasticsearch.common.Randomness; +import org.elasticsearch.common.SuppressForbidden; import org.elasticsearch.common.metrics.MeanMetric; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.watcher.support.clock.SystemClock; @@ -33,6 +34,7 @@ import static org.elasticsearch.watcher.trigger.schedule.Schedules.interval; /** * */ +@SuppressForbidden(reason = "benchmark") public class ScheduleEngineTriggerBenchmark { public static void main(String[] args) throws Exception { diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/bench/WatcherScheduleEngineBenchmark.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/bench/WatcherScheduleEngineBenchmark.java index a1c5ac8a0c4..373f27d8c34 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/bench/WatcherScheduleEngineBenchmark.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/bench/WatcherScheduleEngineBenchmark.java @@ -55,6 +55,7 @@ import static org.elasticsearch.watcher.trigger.schedule.Schedules.interval; /** */ +@SuppressForbidden(reason = "benchmark") public class WatcherScheduleEngineBenchmark { private final static Settings SETTINGS = Settings.builder() @@ -64,7 +65,6 @@ public class WatcherScheduleEngineBenchmark { .put("http.cors.enabled", true) .build(); - @SuppressForbidden(reason = "not really code or a test") public static void main(String[] args) throws Exception { System.setProperty("es.logger.prefix", ""); @@ -252,6 +252,7 @@ public class WatcherScheduleEngineBenchmark { } } + @SuppressForbidden(reason = "benchmark") private static class BenchStats { private final String name;