[TEST] Add another valid exception that can occure with concurrent disconnects

This commit is contained in:
Simon Willnauer 2017-07-05 10:57:45 +02:00
parent 7994703903
commit 8e861b3896
1 changed files with 3 additions and 1 deletions

View File

@ -29,6 +29,7 @@ import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.transport.MockTransportService; import org.elasticsearch.test.transport.MockTransportService;
import org.elasticsearch.threadpool.TestThreadPool; import org.elasticsearch.threadpool.TestThreadPool;
import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPool;
import org.hamcrest.Matchers;
import java.io.IOException; import java.io.IOException;
import java.net.InetAddress; import java.net.InetAddress;
@ -411,7 +412,8 @@ public class RemoteClusterServiceTests extends ESTestCase {
failLatch.await(); failLatch.await();
assertNotNull(ex.get()); assertNotNull(ex.get());
if (ex.get() instanceof IllegalStateException) { 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 { } else {
if (ex.get() instanceof TransportException == false) { if (ex.get() instanceof TransportException == false) {
// we have an issue for this see #25301 // we have an issue for this see #25301