[TEST] Expect nodes getting disconnected quickly

If all nodes get disconnected before we can send the request we might
try to reconnect and that will fail with an ISE instead of the a transport
exception.

Closes #25301
This commit is contained in:
Simon Willnauer 2017-07-02 22:12:35 +02:00
parent a4fae1540e
commit 1205610023
1 changed files with 9 additions and 5 deletions

View File

@ -410,12 +410,16 @@ public class RemoteClusterServiceTests extends ESTestCase {
});
failLatch.await();
assertNotNull(ex.get());
if (ex.get() instanceof TransportException == false) {
// we have an issue for this see #25301
logger.error("expected TransportException but got a different one see #25301", ex.get());
if (ex.get() instanceof IllegalStateException) {
assertEquals(ex.get().getMessage(), "no seed node left");
} else {
if (ex.get() instanceof TransportException == false) {
// we have an issue for this see #25301
logger.error("expected TransportException but got a different one see #25301", ex.get());
}
assertTrue("expected TransportException but got a different one [" + ex.get().getClass().toString() + "]",
ex.get() instanceof TransportException);
}
assertTrue("expected TransportException but got a different one [" + ex.get().getClass().toString() + "]",
ex.get() instanceof TransportException);
}
}
}