From 460e787049589f7e81e9283358e2725c2f34ac65 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Sat, 3 Dec 2016 09:02:44 -0500 Subject: [PATCH] Increase resolve timeout in unknown hosts test The port limit test is a simple test that fakes that resolving an address with a port range results the correct address collection. This test is subject to a race condition where the timeout on the resolve request can fire before the resolve code finishes executing (this race is exceptionally rare, because there are not actually any DNS lookups being done here since we are just resolving addresses). This commit increases the timeout here to significantly reduce the chance of a losing race causing a spurious test failure. This increased timeout should not increase the runtime of the test, just make failures less likely. --- .../org/elasticsearch/discovery/zen/UnicastZenPingTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b284c6f9707..973aa50b56a 100644 --- a/core/src/test/java/org/elasticsearch/discovery/zen/UnicastZenPingTests.java +++ b/core/src/test/java/org/elasticsearch/discovery/zen/UnicastZenPingTests.java @@ -397,7 +397,7 @@ public class UnicastZenPingTests extends ESTestCase { limitPortCounts, transportService, () -> Integer.toString(idGenerator.incrementAndGet()), - TimeValue.timeValueMillis(100)); + TimeValue.timeValueSeconds(1)); assertThat(discoveryNodes, hasSize(limitPortCounts)); final Set ports = new HashSet<>(); for (final DiscoveryNode discoveryNode : discoveryNodes) {