Increase timeouts in UnicastZenPingTests
Sadly, the timeouts here need to be increased to reduce the likelihood of spurious test failures (test hosts under load are especially prone to this). This does slow down this test suite a bit, but it's still not as slow as it was before this endeavor of lowering these timeouts started.
This commit is contained in:
parent
2c8229fcaf
commit
040c05df36
|
@ -225,7 +225,7 @@ public class UnicastZenPingTests extends ESTestCase {
|
||||||
closeables.push(zenPingD);
|
closeables.push(zenPingD);
|
||||||
|
|
||||||
logger.info("ping from UZP_A");
|
logger.info("ping from UZP_A");
|
||||||
Collection<ZenPing.PingResponse> pingResponses = zenPingA.pingAndWait(TimeValue.timeValueMillis(100));
|
Collection<ZenPing.PingResponse> pingResponses = zenPingA.pingAndWait(TimeValue.timeValueMillis(500));
|
||||||
assertThat(pingResponses.size(), equalTo(1));
|
assertThat(pingResponses.size(), equalTo(1));
|
||||||
ZenPing.PingResponse ping = pingResponses.iterator().next();
|
ZenPing.PingResponse ping = pingResponses.iterator().next();
|
||||||
assertThat(ping.node().getId(), equalTo("UZP_B"));
|
assertThat(ping.node().getId(), equalTo("UZP_B"));
|
||||||
|
@ -234,7 +234,7 @@ public class UnicastZenPingTests extends ESTestCase {
|
||||||
|
|
||||||
// ping again, this time from B,
|
// ping again, this time from B,
|
||||||
logger.info("ping from UZP_B");
|
logger.info("ping from UZP_B");
|
||||||
pingResponses = zenPingB.pingAndWait(TimeValue.timeValueMillis(100));
|
pingResponses = zenPingB.pingAndWait(TimeValue.timeValueMillis(500));
|
||||||
assertThat(pingResponses.size(), equalTo(1));
|
assertThat(pingResponses.size(), equalTo(1));
|
||||||
ping = pingResponses.iterator().next();
|
ping = pingResponses.iterator().next();
|
||||||
assertThat(ping.node().getId(), equalTo("UZP_A"));
|
assertThat(ping.node().getId(), equalTo("UZP_A"));
|
||||||
|
@ -242,12 +242,12 @@ public class UnicastZenPingTests extends ESTestCase {
|
||||||
assertCountersMoreThan(handleB, handleA, handleC, handleD);
|
assertCountersMoreThan(handleB, handleA, handleC, handleD);
|
||||||
|
|
||||||
logger.info("ping from UZP_C");
|
logger.info("ping from UZP_C");
|
||||||
pingResponses = zenPingC.pingAndWait(TimeValue.timeValueMillis(100));
|
pingResponses = zenPingC.pingAndWait(TimeValue.timeValueMillis(500));
|
||||||
assertThat(pingResponses.size(), equalTo(0));
|
assertThat(pingResponses.size(), equalTo(0));
|
||||||
assertCountersMoreThan(handleC, handleA, handleB, handleD);
|
assertCountersMoreThan(handleC, handleA, handleB, handleD);
|
||||||
|
|
||||||
logger.info("ping from UZP_D");
|
logger.info("ping from UZP_D");
|
||||||
pingResponses = zenPingD.pingAndWait(TimeValue.timeValueMillis(100));
|
pingResponses = zenPingD.pingAndWait(TimeValue.timeValueMillis(500));
|
||||||
assertThat(pingResponses.size(), equalTo(0));
|
assertThat(pingResponses.size(), equalTo(0));
|
||||||
assertCountersMoreThan(handleD, handleA, handleB, handleC);
|
assertCountersMoreThan(handleD, handleA, handleB, handleC);
|
||||||
}
|
}
|
||||||
|
@ -488,7 +488,7 @@ public class UnicastZenPingTests extends ESTestCase {
|
||||||
new TransportService(Settings.EMPTY, transport, threadPool, TransportService.NOOP_TRANSPORT_INTERCEPTOR, null);
|
new TransportService(Settings.EMPTY, transport, threadPool, TransportService.NOOP_TRANSPORT_INTERCEPTOR, null);
|
||||||
closeables.push(transportService);
|
closeables.push(transportService);
|
||||||
final AtomicInteger idGenerator = new AtomicInteger();
|
final AtomicInteger idGenerator = new AtomicInteger();
|
||||||
final TimeValue resolveTimeout = TimeValue.timeValueMillis(randomIntBetween(100, 200));
|
final TimeValue resolveTimeout = TimeValue.timeValueSeconds(randomIntBetween(1, 3));
|
||||||
try {
|
try {
|
||||||
final List<DiscoveryNode> discoveryNodes = UnicastZenPing.resolveDiscoveryNodes(
|
final List<DiscoveryNode> discoveryNodes = UnicastZenPing.resolveDiscoveryNodes(
|
||||||
executorService,
|
executorService,
|
||||||
|
@ -534,7 +534,7 @@ public class UnicastZenPingTests extends ESTestCase {
|
||||||
1,
|
1,
|
||||||
transportService,
|
transportService,
|
||||||
() -> Integer.toString(idGenerator.incrementAndGet()),
|
() -> Integer.toString(idGenerator.incrementAndGet()),
|
||||||
TimeValue.timeValueMillis(100));
|
TimeValue.timeValueSeconds(1));
|
||||||
assertThat(discoveryNodes, hasSize(1)); // only one of the two is valid and will be used
|
assertThat(discoveryNodes, hasSize(1)); // only one of the two is valid and will be used
|
||||||
assertThat(discoveryNodes.get(0).getAddress().getAddress(), equalTo("127.0.0.1"));
|
assertThat(discoveryNodes.get(0).getAddress().getAddress(), equalTo("127.0.0.1"));
|
||||||
assertThat(discoveryNodes.get(0).getAddress().getPort(), equalTo(9301));
|
assertThat(discoveryNodes.get(0).getAddress().getPort(), equalTo(9301));
|
||||||
|
|
Loading…
Reference in New Issue