Skip to content

Commit

Permalink
Increase await timeouts in RemoteClusterServiceTests
Browse files Browse the repository at this point in the history
Closes #33852
  • Loading branch information
javanna committed Dec 28, 2018
1 parent 0c33a21 commit 5d000ed
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ public void testCollectSearchShards() throws Exception {
AtomicReference<Exception> failure = new AtomicReference<>();
remoteClusterService.collectSearchShards(IndicesOptions.lenientExpandOpen(), null, null, remoteIndicesByCluster,
new LatchedActionListener<>(ActionListener.wrap(response::set, failure::set), latch));
assertTrue(latch.await(1, TimeUnit.SECONDS));
assertTrue(latch.await(5, TimeUnit.SECONDS));
assertNull(failure.get());
assertNotNull(response.get());
Map<String, ClusterSearchShardsResponse> map = response.get();
Expand All @@ -760,7 +760,7 @@ public void testCollectSearchShards() throws Exception {
remoteClusterService.collectSearchShards(IndicesOptions.lenientExpandOpen(), "index_not_found",
null, remoteIndicesByCluster,
new LatchedActionListener<>(ActionListener.wrap(response::set, failure::set), latch));
assertTrue(latch.await(2, TimeUnit.SECONDS));
assertTrue(latch.await(5, TimeUnit.SECONDS));
assertNull(response.get());
assertNotNull(failure.get());
assertThat(failure.get(), instanceOf(RemoteTransportException.class));
Expand Down Expand Up @@ -799,7 +799,7 @@ public void onNodeDisconnected(DiscoveryNode node) {
AtomicReference<Exception> failure = new AtomicReference<>();
remoteClusterService.collectSearchShards(IndicesOptions.lenientExpandOpen(), null, null, remoteIndicesByCluster,
new LatchedActionListener<>(ActionListener.wrap(response::set, failure::set), latch));
assertTrue(latch.await(1, TimeUnit.SECONDS));
assertTrue(latch.await(5, TimeUnit.SECONDS));
assertNull(response.get());
assertNotNull(failure.get());
assertThat(failure.get(), instanceOf(RemoteTransportException.class));
Expand All @@ -817,7 +817,7 @@ public void onNodeDisconnected(DiscoveryNode node) {
AtomicReference<Exception> failure = new AtomicReference<>();
remoteClusterService.collectSearchShards(IndicesOptions.lenientExpandOpen(), null, null, remoteIndicesByCluster,
new LatchedActionListener<>(ActionListener.wrap(response::set, failure::set), latch));
assertTrue(latch.await(1, TimeUnit.SECONDS));
assertTrue(latch.await(5, TimeUnit.SECONDS));
assertNull(failure.get());
assertNotNull(response.get());
Map<String, ClusterSearchShardsResponse> map = response.get();
Expand All @@ -836,7 +836,7 @@ public void onNodeDisconnected(DiscoveryNode node) {

//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
assertTrue(disconnectedLatch.await(1, TimeUnit.SECONDS));
assertTrue(disconnectedLatch.await(5, TimeUnit.SECONDS));

service.clearAllRules();
if (randomBoolean()) {
Expand All @@ -853,7 +853,7 @@ public void onNodeDisconnected(DiscoveryNode node) {
AtomicReference<Exception> failure = new AtomicReference<>();
remoteClusterService.collectSearchShards(IndicesOptions.lenientExpandOpen(), null, null, remoteIndicesByCluster,
new LatchedActionListener<>(ActionListener.wrap(response::set, failure::set), latch));
assertTrue(latch.await(1, TimeUnit.SECONDS));
assertTrue(latch.await(5, TimeUnit.SECONDS));
assertNull(failure.get());
assertNotNull(response.get());
Map<String, ClusterSearchShardsResponse> map = response.get();
Expand All @@ -862,7 +862,7 @@ public void onNodeDisconnected(DiscoveryNode node) {
String clusterAlias = "remote" + i;
assertTrue(map.containsKey(clusterAlias));
ClusterSearchShardsResponse shardsResponse = map.get(clusterAlias);
assertTrue(shardsResponse != ClusterSearchShardsResponse.EMPTY);
assertNotSame(ClusterSearchShardsResponse.EMPTY, shardsResponse);
}
}
assertEquals(0, service.getConnectionManager().size());
Expand Down

0 comments on commit 5d000ed

Please sign in to comment.