Increase lower bound for random resolve timeout in test
The test UnicastZenPing#testResolveTimeout chooses a random resolve timeout between 1ms and 100ms. Close to the lower bound, this is far too short and the test races against the concurrent resolves executing before the timeout elapses. This commit increases the timeout to something that is far less likely to race, yet will not slow the test down since we are not doing resolves against a real DNS service anyway. Note that we still want a short resolve timeout since we are testing whether or not timeouts really work here (by latching one of the resolves to respond slowly).
This commit is contained in:
parent
db5a72774b
commit
1576eaba25
|
@ -484,7 +484,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(1, 100));
|
||||
final TimeValue resolveTimeout = TimeValue.timeValueMillis(randomIntBetween(100, 200));
|
||||
try {
|
||||
final List<DiscoveryNode> discoveryNodes = UnicastZenPing.resolveDiscoveryNodes(
|
||||
executorService,
|
||||
|
|
Loading…
Reference in New Issue