Increase await timeouts in RemoteClusterServiceTests

Closes #33852
This commit is contained in:
Luca Cavanna 2018-12-28 17:03:40 +01:00
parent 4ac8fc6906
commit d3f1fe46d3
1 changed files with 7 additions and 7 deletions

View File

@ -742,7 +742,7 @@ public class RemoteClusterServiceTests extends ESTestCase {
AtomicReference<Exception> failure = new AtomicReference<>(); AtomicReference<Exception> failure = new AtomicReference<>();
remoteClusterService.collectSearchShards(IndicesOptions.lenientExpandOpen(), null, null, remoteIndicesByCluster, remoteClusterService.collectSearchShards(IndicesOptions.lenientExpandOpen(), null, null, remoteIndicesByCluster,
new LatchedActionListener<>(ActionListener.wrap(response::set, failure::set), latch)); new LatchedActionListener<>(ActionListener.wrap(response::set, failure::set), latch));
assertTrue(latch.await(1, TimeUnit.SECONDS)); assertTrue(latch.await(5, TimeUnit.SECONDS));
assertNull(failure.get()); assertNull(failure.get());
assertNotNull(response.get()); assertNotNull(response.get());
Map<String, ClusterSearchShardsResponse> map = response.get(); Map<String, ClusterSearchShardsResponse> map = response.get();
@ -761,7 +761,7 @@ public class RemoteClusterServiceTests extends ESTestCase {
remoteClusterService.collectSearchShards(IndicesOptions.lenientExpandOpen(), "index_not_found", remoteClusterService.collectSearchShards(IndicesOptions.lenientExpandOpen(), "index_not_found",
null, remoteIndicesByCluster, null, remoteIndicesByCluster,
new LatchedActionListener<>(ActionListener.wrap(response::set, failure::set), latch)); new LatchedActionListener<>(ActionListener.wrap(response::set, failure::set), latch));
assertTrue(latch.await(2, TimeUnit.SECONDS)); assertTrue(latch.await(5, TimeUnit.SECONDS));
assertNull(response.get()); assertNull(response.get());
assertNotNull(failure.get()); assertNotNull(failure.get());
assertThat(failure.get(), instanceOf(RemoteTransportException.class)); assertThat(failure.get(), instanceOf(RemoteTransportException.class));
@ -800,7 +800,7 @@ public class RemoteClusterServiceTests extends ESTestCase {
AtomicReference<Exception> failure = new AtomicReference<>(); AtomicReference<Exception> failure = new AtomicReference<>();
remoteClusterService.collectSearchShards(IndicesOptions.lenientExpandOpen(), null, null, remoteIndicesByCluster, remoteClusterService.collectSearchShards(IndicesOptions.lenientExpandOpen(), null, null, remoteIndicesByCluster,
new LatchedActionListener<>(ActionListener.wrap(response::set, failure::set), latch)); new LatchedActionListener<>(ActionListener.wrap(response::set, failure::set), latch));
assertTrue(latch.await(1, TimeUnit.SECONDS)); assertTrue(latch.await(5, TimeUnit.SECONDS));
assertNull(response.get()); assertNull(response.get());
assertNotNull(failure.get()); assertNotNull(failure.get());
assertThat(failure.get(), instanceOf(RemoteTransportException.class)); assertThat(failure.get(), instanceOf(RemoteTransportException.class));
@ -818,7 +818,7 @@ public class RemoteClusterServiceTests extends ESTestCase {
AtomicReference<Exception> failure = new AtomicReference<>(); AtomicReference<Exception> failure = new AtomicReference<>();
remoteClusterService.collectSearchShards(IndicesOptions.lenientExpandOpen(), null, null, remoteIndicesByCluster, remoteClusterService.collectSearchShards(IndicesOptions.lenientExpandOpen(), null, null, remoteIndicesByCluster,
new LatchedActionListener<>(ActionListener.wrap(response::set, failure::set), latch)); new LatchedActionListener<>(ActionListener.wrap(response::set, failure::set), latch));
assertTrue(latch.await(1, TimeUnit.SECONDS)); assertTrue(latch.await(5, TimeUnit.SECONDS));
assertNull(failure.get()); assertNull(failure.get());
assertNotNull(response.get()); assertNotNull(response.get());
Map<String, ClusterSearchShardsResponse> map = response.get(); Map<String, ClusterSearchShardsResponse> map = response.get();
@ -837,7 +837,7 @@ public class RemoteClusterServiceTests extends ESTestCase {
//give transport service enough time to realize that the node is down, and to notify the connection listeners //give transport service enough time to realize that the node is down, and to notify the connection listeners
//so that RemoteClusterConnection is left with no connected nodes, hence it will retry connecting next //so that RemoteClusterConnection is left with no connected nodes, hence it will retry connecting next
assertTrue(disconnectedLatch.await(1, TimeUnit.SECONDS)); assertTrue(disconnectedLatch.await(5, TimeUnit.SECONDS));
service.clearAllRules(); service.clearAllRules();
if (randomBoolean()) { if (randomBoolean()) {
@ -854,7 +854,7 @@ public class RemoteClusterServiceTests extends ESTestCase {
AtomicReference<Exception> failure = new AtomicReference<>(); AtomicReference<Exception> failure = new AtomicReference<>();
remoteClusterService.collectSearchShards(IndicesOptions.lenientExpandOpen(), null, null, remoteIndicesByCluster, remoteClusterService.collectSearchShards(IndicesOptions.lenientExpandOpen(), null, null, remoteIndicesByCluster,
new LatchedActionListener<>(ActionListener.wrap(response::set, failure::set), latch)); new LatchedActionListener<>(ActionListener.wrap(response::set, failure::set), latch));
assertTrue(latch.await(1, TimeUnit.SECONDS)); assertTrue(latch.await(5, TimeUnit.SECONDS));
assertNull(failure.get()); assertNull(failure.get());
assertNotNull(response.get()); assertNotNull(response.get());
Map<String, ClusterSearchShardsResponse> map = response.get(); Map<String, ClusterSearchShardsResponse> map = response.get();
@ -863,7 +863,7 @@ public class RemoteClusterServiceTests extends ESTestCase {
String clusterAlias = "remote" + i; String clusterAlias = "remote" + i;
assertTrue(map.containsKey(clusterAlias)); assertTrue(map.containsKey(clusterAlias));
ClusterSearchShardsResponse shardsResponse = map.get(clusterAlias); ClusterSearchShardsResponse shardsResponse = map.get(clusterAlias);
assertTrue(shardsResponse != ClusterSearchShardsResponse.EMPTY); assertNotSame(ClusterSearchShardsResponse.EMPTY, shardsResponse);
} }
} }
assertEquals(0, service.getConnectionManager().size()); assertEquals(0, service.getConnectionManager().size());