From 040c05df365083c840b9a182e603729927010f8b Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sat, 3 Dec 2016 22:19:55 -0500 Subject: [PATCH] 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. --- .../discovery/zen/UnicastZenPingTests.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/test/java/org/elasticsearch/discovery/zen/UnicastZenPingTests.java b/core/src/test/java/org/elasticsearch/discovery/zen/UnicastZenPingTests.java index c792feeecf8..c8068f18ef9 100644 --- a/core/src/test/java/org/elasticsearch/discovery/zen/UnicastZenPingTests.java +++ b/core/src/test/java/org/elasticsearch/discovery/zen/UnicastZenPingTests.java @@ -225,7 +225,7 @@ public class UnicastZenPingTests extends ESTestCase { closeables.push(zenPingD); logger.info("ping from UZP_A"); - Collection pingResponses = zenPingA.pingAndWait(TimeValue.timeValueMillis(100)); + Collection pingResponses = zenPingA.pingAndWait(TimeValue.timeValueMillis(500)); assertThat(pingResponses.size(), equalTo(1)); ZenPing.PingResponse ping = pingResponses.iterator().next(); assertThat(ping.node().getId(), equalTo("UZP_B")); @@ -234,7 +234,7 @@ public class UnicastZenPingTests extends ESTestCase { // ping again, this time from B, logger.info("ping from UZP_B"); - pingResponses = zenPingB.pingAndWait(TimeValue.timeValueMillis(100)); + pingResponses = zenPingB.pingAndWait(TimeValue.timeValueMillis(500)); assertThat(pingResponses.size(), equalTo(1)); ping = pingResponses.iterator().next(); assertThat(ping.node().getId(), equalTo("UZP_A")); @@ -242,12 +242,12 @@ public class UnicastZenPingTests extends ESTestCase { assertCountersMoreThan(handleB, handleA, handleC, handleD); logger.info("ping from UZP_C"); - pingResponses = zenPingC.pingAndWait(TimeValue.timeValueMillis(100)); + pingResponses = zenPingC.pingAndWait(TimeValue.timeValueMillis(500)); assertThat(pingResponses.size(), equalTo(0)); assertCountersMoreThan(handleC, handleA, handleB, handleD); logger.info("ping from UZP_D"); - pingResponses = zenPingD.pingAndWait(TimeValue.timeValueMillis(100)); + pingResponses = zenPingD.pingAndWait(TimeValue.timeValueMillis(500)); assertThat(pingResponses.size(), equalTo(0)); 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); closeables.push(transportService); final AtomicInteger idGenerator = new AtomicInteger(); - final TimeValue resolveTimeout = TimeValue.timeValueMillis(randomIntBetween(100, 200)); + final TimeValue resolveTimeout = TimeValue.timeValueSeconds(randomIntBetween(1, 3)); try { final List discoveryNodes = UnicastZenPing.resolveDiscoveryNodes( executorService, @@ -534,7 +534,7 @@ public class UnicastZenPingTests extends ESTestCase { 1, transportService, () -> 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.get(0).getAddress().getAddress(), equalTo("127.0.0.1")); assertThat(discoveryNodes.get(0).getAddress().getPort(), equalTo(9301));