Search in sources :

Example 11 with MockLogAppender

use of org.opensearch.test.MockLogAppender in project OpenSearch by opensearch-project.

the class PluginsServiceTests method testFindPluginDirs.

public void testFindPluginDirs() throws Exception {
    final Path plugins = createTempDir();
    try (MockLogAppender mockLogAppender = MockLogAppender.createForLoggers(LogManager.getLogger(PluginsService.class))) {
        mockLogAppender.addExpectation(new MockLogAppender.SeenEventExpectation("[.test] warning", "org.opensearch.plugins.PluginsService", Level.WARN, "Non-plugin file located in the plugins folder with the following name: [.DS_Store]"));
        final Path fake = plugins.resolve("fake");
        Path testFile = plugins.resolve(".DS_Store");
        Files.createFile(testFile);
        PluginTestUtil.writePluginProperties(fake, "description", "description", "name", "fake", "version", "1.0.0", "opensearch.version", Version.CURRENT.toString(), "java.version", System.getProperty("java.specification.version"), "classname", "test.DummyPlugin");
        try (InputStream jar = PluginsServiceTests.class.getResourceAsStream("dummy-plugin.jar")) {
            Files.copy(jar, fake.resolve("plugin.jar"));
        }
        assertThat(PluginsService.findPluginDirs(plugins), containsInAnyOrder(fake));
        mockLogAppender.assertAllExpectationsMatched();
    }
}
Also used : Path(java.nio.file.Path) MockLogAppender(org.opensearch.test.MockLogAppender) ZipInputStream(java.util.zip.ZipInputStream) InputStream(java.io.InputStream)

Example 12 with MockLogAppender

use of org.opensearch.test.MockLogAppender in project OpenSearch by opensearch-project.

the class AbstractSimpleTransportTestCase method testTracerLog.

@TestLogging(value = "org.opensearch.transport.TransportService.tracer:trace", reason = "to ensure we log network events on TRACE level")
public void testTracerLog() throws Exception {
    TransportRequestHandler<TransportRequest> handler = (request, channel, task) -> channel.sendResponse(new StringMessageResponse(""));
    TransportRequestHandler<StringMessageRequest> handlerWithError = (request, channel, task) -> {
        if (request.timeout() > 0) {
            Thread.sleep(request.timeout);
        }
        channel.sendResponse(new RuntimeException(""));
    };
    TransportResponseHandler<StringMessageResponse> noopResponseHandler = new TransportResponseHandler<StringMessageResponse>() {

        @Override
        public StringMessageResponse read(StreamInput in) throws IOException {
            return new StringMessageResponse(in);
        }

        @Override
        public void handleResponse(StringMessageResponse response) {
        }

        @Override
        public void handleException(TransportException exp) {
        }

        @Override
        public String executor() {
            return ThreadPool.Names.SAME;
        }
    };
    serviceA.registerRequestHandler("internal:test", ThreadPool.Names.SAME, StringMessageRequest::new, handler);
    serviceA.registerRequestHandler("internal:testNotSeen", ThreadPool.Names.SAME, StringMessageRequest::new, handler);
    serviceA.registerRequestHandler("internal:testError", ThreadPool.Names.SAME, StringMessageRequest::new, handlerWithError);
    serviceB.registerRequestHandler("internal:test", ThreadPool.Names.SAME, StringMessageRequest::new, handler);
    serviceB.registerRequestHandler("internal:testNotSeen", ThreadPool.Names.SAME, StringMessageRequest::new, handler);
    serviceB.registerRequestHandler("internal:testError", ThreadPool.Names.SAME, StringMessageRequest::new, handlerWithError);
    String includeSettings;
    String excludeSettings;
    if (randomBoolean()) {
        // sometimes leave include empty (default)
        includeSettings = randomBoolean() ? "*" : "";
        excludeSettings = "internal:testNotSeen";
    } else {
        includeSettings = "internal:test,internal:testError";
        excludeSettings = "DOESN'T_MATCH";
    }
    clusterSettingsA.applySettings(Settings.builder().put(TransportSettings.TRACE_LOG_INCLUDE_SETTING.getKey(), includeSettings).put(TransportSettings.TRACE_LOG_EXCLUDE_SETTING.getKey(), excludeSettings).build());
    final Logger logger = LogManager.getLogger("org.opensearch.transport.TransportService.tracer");
    try (MockLogAppender appender = MockLogAppender.createForLoggers(logger)) {
        final String requestSent = ".*\\[internal:test].*sent to.*\\{TS_B}.*";
        final MockLogAppender.LoggingExpectation requestSentExpectation = new MockLogAppender.PatternSeenEventExpectation("sent request", "org.opensearch.transport.TransportService.tracer", Level.TRACE, requestSent);
        final String requestReceived = ".*\\[internal:test].*received request.*";
        final MockLogAppender.LoggingExpectation requestReceivedExpectation = new MockLogAppender.PatternSeenEventExpectation("received request", "org.opensearch.transport.TransportService.tracer", Level.TRACE, requestReceived);
        final String responseSent = ".*\\[internal:test].*sent response.*";
        final MockLogAppender.LoggingExpectation responseSentExpectation = new MockLogAppender.PatternSeenEventExpectation("sent response", "org.opensearch.transport.TransportService.tracer", Level.TRACE, responseSent);
        final String responseReceived = ".*\\[internal:test].*received response from.*\\{TS_B}.*";
        final MockLogAppender.LoggingExpectation responseReceivedExpectation = new MockLogAppender.PatternSeenEventExpectation("received response", "org.opensearch.transport.TransportService.tracer", Level.TRACE, responseReceived);
        appender.addExpectation(requestSentExpectation);
        appender.addExpectation(requestReceivedExpectation);
        appender.addExpectation(responseSentExpectation);
        appender.addExpectation(responseReceivedExpectation);
        StringMessageRequest request = new StringMessageRequest("", 10);
        serviceA.sendRequest(nodeB, "internal:test", request, TransportRequestOptions.EMPTY, noopResponseHandler);
        assertBusy(appender::assertAllExpectationsMatched);
        final String errorResponseSent = ".*\\[internal:testError].*sent error response.*";
        final MockLogAppender.LoggingExpectation errorResponseSentExpectation = new MockLogAppender.PatternSeenEventExpectation("sent error response", "org.opensearch.transport.TransportService.tracer", Level.TRACE, errorResponseSent);
        final String errorResponseReceived = ".*\\[internal:testError].*received response from.*\\{TS_B}.*";
        final MockLogAppender.LoggingExpectation errorResponseReceivedExpectation = new MockLogAppender.PatternSeenEventExpectation("received error response", "org.opensearch.transport.TransportService.tracer", Level.TRACE, errorResponseReceived);
        appender.addExpectation(errorResponseSentExpectation);
        appender.addExpectation(errorResponseReceivedExpectation);
        serviceA.sendRequest(nodeB, "internal:testError", new StringMessageRequest(""), noopResponseHandler);
        assertBusy(appender::assertAllExpectationsMatched);
        final String notSeenSent = "*[internal:testNotSeen]*sent to*";
        final MockLogAppender.LoggingExpectation notSeenSentExpectation = new MockLogAppender.UnseenEventExpectation("not seen request sent", "org.opensearch.transport.TransportService.tracer", Level.TRACE, notSeenSent);
        final String notSeenReceived = ".*\\[internal:testNotSeen].*received request.*";
        final MockLogAppender.LoggingExpectation notSeenReceivedExpectation = new MockLogAppender.PatternSeenEventExpectation("not seen request received", "org.opensearch.transport.TransportService.tracer", Level.TRACE, notSeenReceived);
        appender.addExpectation(notSeenSentExpectation);
        appender.addExpectation(notSeenReceivedExpectation);
        PlainTransportFuture<StringMessageResponse> future = new PlainTransportFuture<>(noopResponseHandler);
        serviceA.sendRequest(nodeB, "internal:testNotSeen", new StringMessageRequest(""), future);
        future.txGet();
        assertBusy(appender::assertAllExpectationsMatched);
    }
}
Also used : Matchers.hasToString(org.hamcrest.Matchers.hasToString) Arrays(java.util.Arrays) AbstractRunnable(org.opensearch.common.util.concurrent.AbstractRunnable) StubbableTransport(org.opensearch.test.transport.StubbableTransport) TestThreadPool(org.opensearch.threadpool.TestThreadPool) Matchers.not(org.hamcrest.Matchers.not) Level(org.apache.logging.log4j.Level) Version(org.opensearch.Version) BoundTransportAddress(org.opensearch.common.transport.BoundTransportAddress) OpenSearchException(org.opensearch.OpenSearchException) ConcurrentCollections(org.opensearch.common.util.concurrent.ConcurrentCollections) InetAddress(java.net.InetAddress) ServerSocket(java.net.ServerSocket) DiscoveryNode(org.opensearch.cluster.node.DiscoveryNode) PlainActionFuture(org.opensearch.action.support.PlainActionFuture) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) After(org.junit.After) Map(java.util.Map) Matchers.nullValue(org.hamcrest.Matchers.nullValue) ActionListener(org.opensearch.action.ActionListener) SuppressForbidden(org.opensearch.common.SuppressForbidden) CyclicBarrier(java.util.concurrent.CyclicBarrier) TimeValue(org.opensearch.common.unit.TimeValue) Matchers.notNullValue(org.hamcrest.Matchers.notNullValue) OpenSearchTestCase(org.opensearch.test.OpenSearchTestCase) ExceptionsHelper(org.opensearch.ExceptionsHelper) Set(java.util.Set) Settings(org.opensearch.common.settings.Settings) Task(org.opensearch.tasks.Task) InetSocketAddress(java.net.InetSocketAddress) Collectors(java.util.stream.Collectors) Nullable(org.opensearch.common.Nullable) Matchers.startsWith(org.hamcrest.Matchers.startsWith) TransportAddress(org.opensearch.common.transport.TransportAddress) UncheckedIOException(java.io.UncheckedIOException) Matchers.instanceOf(org.hamcrest.Matchers.instanceOf) CloseableChannel(org.opensearch.common.network.CloseableChannel) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) Logger(org.apache.logging.log4j.Logger) Supplier(org.apache.logging.log4j.util.Supplier) Matchers.equalTo(org.hamcrest.Matchers.equalTo) ActionListenerResponseHandler(org.opensearch.action.ActionListenerResponseHandler) Matchers.containsString(org.hamcrest.Matchers.containsString) NOOP_TRANSPORT_INTERCEPTOR(org.opensearch.transport.TransportService.NOOP_TRANSPORT_INTERCEPTOR) MockLogAppender(org.opensearch.test.MockLogAppender) Socket(java.net.Socket) ThreadPool(org.opensearch.threadpool.ThreadPool) NetworkUtils(org.opensearch.common.network.NetworkUtils) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) StreamOutput(org.opensearch.common.io.stream.StreamOutput) HashMap(java.util.HashMap) Node(org.opensearch.node.Node) MockTransportService(org.opensearch.test.transport.MockTransportService) ParameterizedMessage(org.apache.logging.log4j.message.ParameterizedMessage) AtomicReference(java.util.concurrent.atomic.AtomicReference) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) LegacyESVersion(org.opensearch.LegacyESVersion) VersionUtils(org.opensearch.test.VersionUtils) ClusterSettings(org.opensearch.common.settings.ClusterSettings) Before(org.junit.Before) StreamInput(org.opensearch.common.io.stream.StreamInput) NetworkAddress(org.opensearch.common.network.NetworkAddress) Collections.emptyMap(java.util.Collections.emptyMap) Matchers.empty(org.hamcrest.Matchers.empty) Setting(org.opensearch.common.settings.Setting) Collections.emptySet(java.util.Collections.emptySet) Semaphore(java.util.concurrent.Semaphore) IOException(java.io.IOException) BrokenBarrierException(java.util.concurrent.BrokenBarrierException) BytesStreamOutput(org.opensearch.common.io.stream.BytesStreamOutput) Inet4Address(java.net.Inet4Address) UnknownHostException(java.net.UnknownHostException) CollectionUtil(org.apache.lucene.util.CollectionUtil) IOUtils(org.opensearch.core.internal.io.IOUtils) TestLogging(org.opensearch.test.junit.annotations.TestLogging) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) Inet6Address(java.net.Inet6Address) Constants(org.apache.lucene.util.Constants) LogManager(org.apache.logging.log4j.LogManager) Collections(java.util.Collections) MockLogAppender(org.opensearch.test.MockLogAppender) Matchers.hasToString(org.hamcrest.Matchers.hasToString) Matchers.containsString(org.hamcrest.Matchers.containsString) Logger(org.apache.logging.log4j.Logger) StreamInput(org.opensearch.common.io.stream.StreamInput) TestLogging(org.opensearch.test.junit.annotations.TestLogging)

Example 13 with MockLogAppender

use of org.opensearch.test.MockLogAppender in project OpenSearch by opensearch-project.

the class ClusterApplierServiceTests method testLongClusterStateUpdateLogging.

@TestLogging(value = "org.opensearch.cluster.service:WARN", reason = "to ensure that we log cluster state events on WARN level")
public void testLongClusterStateUpdateLogging() throws Exception {
    try (MockLogAppender mockAppender = MockLogAppender.createForLoggers(LogManager.getLogger(ClusterApplierService.class))) {
        mockAppender.addExpectation(new MockLogAppender.UnseenEventExpectation("test1 shouldn't see because setting is too low", ClusterApplierService.class.getCanonicalName(), Level.WARN, "*cluster state applier task [test1] took [*] which is above the warn threshold of *"));
        mockAppender.addExpectation(new MockLogAppender.SeenEventExpectation("test2", ClusterApplierService.class.getCanonicalName(), Level.WARN, "*cluster state applier task [test2] took [32s] which is above the warn threshold of [*]: " + "[running task [test2]] took [*"));
        mockAppender.addExpectation(new MockLogAppender.SeenEventExpectation("test4", ClusterApplierService.class.getCanonicalName(), Level.WARN, "*cluster state applier task [test3] took [34s] which is above the warn threshold of [*]: " + "[running task [test3]] took [*"));
        final CountDownLatch latch = new CountDownLatch(4);
        final CountDownLatch processedFirstTask = new CountDownLatch(1);
        clusterApplierService.currentTimeOverride = threadPool.relativeTimeInMillis();
        clusterApplierService.runOnApplierThread("test1", currentState -> clusterApplierService.currentTimeOverride += TimeValue.timeValueSeconds(1).millis(), new ClusterApplyListener() {

            @Override
            public void onSuccess(String source) {
                latch.countDown();
                processedFirstTask.countDown();
            }

            @Override
            public void onFailure(String source, Exception e) {
                fail();
            }
        });
        processedFirstTask.await();
        clusterApplierService.runOnApplierThread("test2", currentState -> {
            clusterApplierService.currentTimeOverride += TimeValue.timeValueSeconds(32).millis();
            throw new IllegalArgumentException("Testing handling of exceptions in the cluster state task");
        }, new ClusterApplyListener() {

            @Override
            public void onSuccess(String source) {
                fail();
            }

            @Override
            public void onFailure(String source, Exception e) {
                latch.countDown();
            }
        });
        clusterApplierService.runOnApplierThread("test3", currentState -> clusterApplierService.currentTimeOverride += TimeValue.timeValueSeconds(34).millis(), new ClusterApplyListener() {

            @Override
            public void onSuccess(String source) {
                latch.countDown();
            }

            @Override
            public void onFailure(String source, Exception e) {
                fail();
            }
        });
        // Additional update task to make sure all previous logging made it to the loggerName
        // We don't check logging for this on since there is no guarantee that it will occur before our check
        clusterApplierService.runOnApplierThread("test4", currentState -> {
        }, new ClusterApplyListener() {

            @Override
            public void onSuccess(String source) {
                latch.countDown();
            }

            @Override
            public void onFailure(String source, Exception e) {
                fail();
            }
        });
        latch.await();
        mockAppender.assertAllExpectationsMatched();
    }
}
Also used : MockLogAppender(org.opensearch.test.MockLogAppender) ClusterApplyListener(org.opensearch.cluster.service.ClusterApplier.ClusterApplyListener) Matchers.containsString(org.hamcrest.Matchers.containsString) CountDownLatch(java.util.concurrent.CountDownLatch) TestLogging(org.opensearch.test.junit.annotations.TestLogging)

Example 14 with MockLogAppender

use of org.opensearch.test.MockLogAppender in project OpenSearch by opensearch-project.

the class ClusterApplierServiceTests method testClusterStateUpdateLogging.

@TestLogging(value = "org.opensearch.cluster.service:TRACE", reason = "to ensure that we log cluster state events on TRACE level")
public void testClusterStateUpdateLogging() throws Exception {
    try (MockLogAppender mockAppender = MockLogAppender.createForLoggers(LogManager.getLogger(ClusterApplierService.class))) {
        mockAppender.addExpectation(new MockLogAppender.SeenEventExpectation("test1", ClusterApplierService.class.getCanonicalName(), Level.DEBUG, "*processing [test1]: took [1s] no change in cluster state"));
        mockAppender.addExpectation(new MockLogAppender.SeenEventExpectation("test2", ClusterApplierService.class.getCanonicalName(), Level.TRACE, "*failed to execute cluster state applier in [2s]*"));
        mockAppender.addExpectation(new MockLogAppender.SeenEventExpectation("test3", ClusterApplierService.class.getCanonicalName(), Level.DEBUG, "*processing [test3]: took [0s] no change in cluster state*"));
        clusterApplierService.currentTimeOverride = threadPool.relativeTimeInMillis();
        clusterApplierService.runOnApplierThread("test1", currentState -> clusterApplierService.currentTimeOverride += TimeValue.timeValueSeconds(1).millis(), new ClusterApplyListener() {

            @Override
            public void onSuccess(String source) {
            }

            @Override
            public void onFailure(String source, Exception e) {
                fail();
            }
        });
        clusterApplierService.runOnApplierThread("test2", currentState -> {
            clusterApplierService.currentTimeOverride += TimeValue.timeValueSeconds(2).millis();
            throw new IllegalArgumentException("Testing handling of exceptions in the cluster state task");
        }, new ClusterApplyListener() {

            @Override
            public void onSuccess(String source) {
                fail();
            }

            @Override
            public void onFailure(String source, Exception e) {
            }
        });
        // Additional update task to make sure all previous logging made it to the loggerName
        clusterApplierService.runOnApplierThread("test3", currentState -> {
        }, new ClusterApplyListener() {

            @Override
            public void onSuccess(String source) {
            }

            @Override
            public void onFailure(String source, Exception e) {
                fail();
            }
        });
        assertBusy(mockAppender::assertAllExpectationsMatched);
    }
}
Also used : MockLogAppender(org.opensearch.test.MockLogAppender) ClusterApplyListener(org.opensearch.cluster.service.ClusterApplier.ClusterApplyListener) Matchers.containsString(org.hamcrest.Matchers.containsString) TestLogging(org.opensearch.test.junit.annotations.TestLogging)

Example 15 with MockLogAppender

use of org.opensearch.test.MockLogAppender in project OpenSearch by opensearch-project.

the class MasterServiceTests method testClusterStateUpdateLogging.

@TestLogging(value = "org.opensearch.cluster.service:TRACE", reason = "to ensure that we log cluster state events on TRACE level")
public void testClusterStateUpdateLogging() throws Exception {
    try (MockLogAppender mockAppender = MockLogAppender.createForLoggers(LogManager.getLogger(MasterService.class))) {
        mockAppender.addExpectation(new MockLogAppender.SeenEventExpectation("test1 start", MasterService.class.getCanonicalName(), Level.DEBUG, "executing cluster state update for [test1]"));
        mockAppender.addExpectation(new MockLogAppender.SeenEventExpectation("test1 computation", MasterService.class.getCanonicalName(), Level.DEBUG, "took [1s] to compute cluster state update for [test1]"));
        mockAppender.addExpectation(new MockLogAppender.SeenEventExpectation("test1 notification", MasterService.class.getCanonicalName(), Level.DEBUG, "took [0s] to notify listeners on unchanged cluster state for [test1]"));
        mockAppender.addExpectation(new MockLogAppender.SeenEventExpectation("test2 start", MasterService.class.getCanonicalName(), Level.DEBUG, "executing cluster state update for [test2]"));
        mockAppender.addExpectation(new MockLogAppender.SeenEventExpectation("test2 failure", MasterService.class.getCanonicalName(), Level.TRACE, "failed to execute cluster state update (on version: [*], uuid: [*]) for [test2]*"));
        mockAppender.addExpectation(new MockLogAppender.SeenEventExpectation("test2 computation", MasterService.class.getCanonicalName(), Level.DEBUG, "took [2s] to compute cluster state update for [test2]"));
        mockAppender.addExpectation(new MockLogAppender.SeenEventExpectation("test2 notification", MasterService.class.getCanonicalName(), Level.DEBUG, "took [0s] to notify listeners on unchanged cluster state for [test2]"));
        mockAppender.addExpectation(new MockLogAppender.SeenEventExpectation("test3 start", MasterService.class.getCanonicalName(), Level.DEBUG, "executing cluster state update for [test3]"));
        mockAppender.addExpectation(new MockLogAppender.SeenEventExpectation("test3 computation", MasterService.class.getCanonicalName(), Level.DEBUG, "took [3s] to compute cluster state update for [test3]"));
        mockAppender.addExpectation(new MockLogAppender.SeenEventExpectation("test3 notification", MasterService.class.getCanonicalName(), Level.DEBUG, "took [4s] to notify listeners on successful publication of cluster state (version: *, uuid: *) for [test3]"));
        mockAppender.addExpectation(new MockLogAppender.SeenEventExpectation("test4", MasterService.class.getCanonicalName(), Level.DEBUG, "executing cluster state update for [test4]"));
        try (MasterService clusterManagerService = createClusterManagerService(true)) {
            clusterManagerService.submitStateUpdateTask("test1", new ClusterStateUpdateTask() {

                @Override
                public ClusterState execute(ClusterState currentState) {
                    relativeTimeInMillis += TimeValue.timeValueSeconds(1).millis();
                    return currentState;
                }

                @Override
                public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) {
                }

                @Override
                public void onFailure(String source, Exception e) {
                    fail();
                }
            });
            clusterManagerService.submitStateUpdateTask("test2", new ClusterStateUpdateTask() {

                @Override
                public ClusterState execute(ClusterState currentState) {
                    relativeTimeInMillis += TimeValue.timeValueSeconds(2).millis();
                    throw new IllegalArgumentException("Testing handling of exceptions in the cluster state task");
                }

                @Override
                public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) {
                    fail();
                }

                @Override
                public void onFailure(String source, Exception e) {
                }
            });
            clusterManagerService.submitStateUpdateTask("test3", new ClusterStateUpdateTask() {

                @Override
                public ClusterState execute(ClusterState currentState) {
                    relativeTimeInMillis += TimeValue.timeValueSeconds(3).millis();
                    return ClusterState.builder(currentState).incrementVersion().build();
                }

                @Override
                public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) {
                    relativeTimeInMillis += TimeValue.timeValueSeconds(4).millis();
                }

                @Override
                public void onFailure(String source, Exception e) {
                    fail();
                }
            });
            clusterManagerService.submitStateUpdateTask("test4", new ClusterStateUpdateTask() {

                @Override
                public ClusterState execute(ClusterState currentState) {
                    return currentState;
                }

                @Override
                public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) {
                }

                @Override
                public void onFailure(String source, Exception e) {
                    fail();
                }
            });
            assertBusy(mockAppender::assertAllExpectationsMatched);
        }
    }
}
Also used : ClusterState(org.opensearch.cluster.ClusterState) MockLogAppender(org.opensearch.test.MockLogAppender) ClusterStateUpdateTask(org.opensearch.cluster.ClusterStateUpdateTask) AckedClusterStateUpdateTask(org.opensearch.cluster.AckedClusterStateUpdateTask) Matchers.containsString(org.hamcrest.Matchers.containsString) OpenSearchException(org.opensearch.OpenSearchException) FailedToCommitClusterStateException(org.opensearch.cluster.coordination.FailedToCommitClusterStateException) BrokenBarrierException(java.util.concurrent.BrokenBarrierException) TestLogging(org.opensearch.test.junit.annotations.TestLogging)

Aggregations

MockLogAppender (org.opensearch.test.MockLogAppender)29 Logger (org.apache.logging.log4j.Logger)11 TestLogging (org.opensearch.test.junit.annotations.TestLogging)10 Matchers.containsString (org.hamcrest.Matchers.containsString)8 DiscoveryNode (org.opensearch.cluster.node.DiscoveryNode)5 OpenSearchException (org.opensearch.OpenSearchException)4 ClusterState (org.opensearch.cluster.ClusterState)4 ClusterSettings (org.opensearch.common.settings.ClusterSettings)4 Settings (org.opensearch.common.settings.Settings)4 Path (java.nio.file.Path)3 HashSet (java.util.HashSet)3 BrokenBarrierException (java.util.concurrent.BrokenBarrierException)3 CountDownLatch (java.util.concurrent.CountDownLatch)3 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)3 LogEvent (org.apache.logging.log4j.core.LogEvent)3 Version (org.opensearch.Version)3 ClusterNode (org.opensearch.cluster.coordination.AbstractCoordinatorTestCase.Cluster.ClusterNode)3 IOException (java.io.IOException)2 InetSocketAddress (java.net.InetSocketAddress)2 UnknownHostException (java.net.UnknownHostException)2