Skip to content

Commit

Permalink
Increase timeout for DnsNameResolverTest
Browse files Browse the repository at this point in the history
Motivation:
DnsNameResolverTest has been observed to timeout on the CI servers. We should increase the timeout from 5 seconds to 30 seconds.

Modifications:
- Increase timeout from 5 to 30 seconds.

Result:
Less false failures due to slower CI machines.
  • Loading branch information
Scottmitch authored and normanmaurer committed Jul 19, 2017
1 parent d125ade commit 0afe4e0
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
public class DnsNameResolverTest {

private static final InternalLogger logger = InternalLoggerFactory.getInstance(DnsNameResolver.class);
private static final long DEFAULT_TEST_TIMEOUT_MS = 30000;

// Using the top-100 web sites ranked in Alexa.com (Oct 2014)
// Please use the following series of shell commands to get this up-to-date:
Expand Down Expand Up @@ -474,12 +475,12 @@ public void testNonCachedResolve() throws Exception {
}
}

@Test(timeout = 5000)
@Test(timeout = DEFAULT_TEST_TIMEOUT_MS)
public void testNonCachedResolveEmptyHostName() throws Exception {
testNonCachedResolveEmptyHostName("");
}

@Test(timeout = 5000)
@Test(timeout = DEFAULT_TEST_TIMEOUT_MS)
public void testNonCachedResolveNullHostName() throws Exception {
testNonCachedResolveEmptyHostName(null);
}
Expand All @@ -494,12 +495,12 @@ public void testNonCachedResolveEmptyHostName(String inetHost) throws Exception
}
}

@Test(timeout = 5000)
@Test(timeout = DEFAULT_TEST_TIMEOUT_MS)
public void testNonCachedResolveAllEmptyHostName() throws Exception {
testNonCachedResolveAllEmptyHostName("");
}

@Test(timeout = 5000)
@Test(timeout = DEFAULT_TEST_TIMEOUT_MS)
public void testNonCachedResolveAllNullHostName() throws Exception {
testNonCachedResolveAllEmptyHostName(null);
}
Expand Down Expand Up @@ -642,7 +643,7 @@ public void run() {
};

negativeLookupThread.start();
negativeLookupThread.join(5000);
negativeLookupThread.join(DEFAULT_TEST_TIMEOUT_MS);

if (negativeLookupThread.isAlive()) {
negativeLookupThread.interrupt();
Expand Down Expand Up @@ -788,12 +789,12 @@ private static void testResolveUnicode(boolean decode) {
}
}

@Test(timeout = 5000)
@Test(timeout = DEFAULT_TEST_TIMEOUT_MS)
public void secondDnsServerShouldBeUsedBeforeCNAMEFirstServerNotStarted() throws IOException {
secondDnsServerShouldBeUsedBeforeCNAME(false);
}

@Test(timeout = 5000)
@Test(timeout = DEFAULT_TEST_TIMEOUT_MS)
public void secondDnsServerShouldBeUsedBeforeCNAMEFirstServerFailResolve() throws IOException {
secondDnsServerShouldBeUsedBeforeCNAME(true);
}
Expand Down Expand Up @@ -852,7 +853,7 @@ private static void secondDnsServerShouldBeUsedBeforeCNAME(boolean startDnsServe
}
}

@Test(timeout = 5000)
@Test(timeout = DEFAULT_TEST_TIMEOUT_MS)
public void aAndAAAAQueryShouldTryFirstDnsServerBeforeSecond() throws IOException {
final String knownHostName = "netty.io";
final TestDnsServer dnsServer1 = new TestDnsServer(new HashSet<String>(Arrays.asList("notnetty.com")));
Expand Down

0 comments on commit 0afe4e0

Please sign in to comment.