From 8e861b3896af9323bdb509ccc62fa3fe1446ee31 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Wed, 5 Jul 2017 10:57:45 +0200 Subject: [PATCH] [TEST] Add another valid exception that can occure with concurrent disconnects --- .../elasticsearch/transport/RemoteClusterServiceTests.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/test/java/org/elasticsearch/transport/RemoteClusterServiceTests.java b/core/src/test/java/org/elasticsearch/transport/RemoteClusterServiceTests.java index 1dbd9352294..a535988c6d6 100644 --- a/core/src/test/java/org/elasticsearch/transport/RemoteClusterServiceTests.java +++ b/core/src/test/java/org/elasticsearch/transport/RemoteClusterServiceTests.java @@ -29,6 +29,7 @@ import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.transport.MockTransportService; import org.elasticsearch.threadpool.TestThreadPool; import org.elasticsearch.threadpool.ThreadPool; +import org.hamcrest.Matchers; import java.io.IOException; import java.net.InetAddress; @@ -411,7 +412,8 @@ public class RemoteClusterServiceTests extends ESTestCase { failLatch.await(); assertNotNull(ex.get()); if (ex.get() instanceof IllegalStateException) { - assertEquals(ex.get().getMessage(), "no seed node left"); + assertThat(ex.get().getMessage(), Matchers.anyOf(Matchers.equalTo("no seed node left"), Matchers.startsWith + ("No node available for cluster:"))); } else { if (ex.get() instanceof TransportException == false) { // we have an issue for this see #25301