@@ -741,7 +741,7 @@ public void testCollectSearchShards() throws Exception {
741
741
AtomicReference <Exception > failure = new AtomicReference <>();
742
742
remoteClusterService .collectSearchShards (IndicesOptions .lenientExpandOpen (), null , null , remoteIndicesByCluster ,
743
743
new LatchedActionListener <>(ActionListener .wrap (response ::set , failure ::set ), latch ));
744
- assertTrue (latch .await (1 , TimeUnit .SECONDS ));
744
+ assertTrue (latch .await (5 , TimeUnit .SECONDS ));
745
745
assertNull (failure .get ());
746
746
assertNotNull (response .get ());
747
747
Map <String , ClusterSearchShardsResponse > map = response .get ();
@@ -760,7 +760,7 @@ public void testCollectSearchShards() throws Exception {
760
760
remoteClusterService .collectSearchShards (IndicesOptions .lenientExpandOpen (), "index_not_found" ,
761
761
null , remoteIndicesByCluster ,
762
762
new LatchedActionListener <>(ActionListener .wrap (response ::set , failure ::set ), latch ));
763
- assertTrue (latch .await (2 , TimeUnit .SECONDS ));
763
+ assertTrue (latch .await (5 , TimeUnit .SECONDS ));
764
764
assertNull (response .get ());
765
765
assertNotNull (failure .get ());
766
766
assertThat (failure .get (), instanceOf (RemoteTransportException .class ));
@@ -799,7 +799,7 @@ public void onNodeDisconnected(DiscoveryNode node) {
799
799
AtomicReference <Exception > failure = new AtomicReference <>();
800
800
remoteClusterService .collectSearchShards (IndicesOptions .lenientExpandOpen (), null , null , remoteIndicesByCluster ,
801
801
new LatchedActionListener <>(ActionListener .wrap (response ::set , failure ::set ), latch ));
802
- assertTrue (latch .await (1 , TimeUnit .SECONDS ));
802
+ assertTrue (latch .await (5 , TimeUnit .SECONDS ));
803
803
assertNull (response .get ());
804
804
assertNotNull (failure .get ());
805
805
assertThat (failure .get (), instanceOf (RemoteTransportException .class ));
@@ -817,7 +817,7 @@ public void onNodeDisconnected(DiscoveryNode node) {
817
817
AtomicReference <Exception > failure = new AtomicReference <>();
818
818
remoteClusterService .collectSearchShards (IndicesOptions .lenientExpandOpen (), null , null , remoteIndicesByCluster ,
819
819
new LatchedActionListener <>(ActionListener .wrap (response ::set , failure ::set ), latch ));
820
- assertTrue (latch .await (1 , TimeUnit .SECONDS ));
820
+ assertTrue (latch .await (5 , TimeUnit .SECONDS ));
821
821
assertNull (failure .get ());
822
822
assertNotNull (response .get ());
823
823
Map <String , ClusterSearchShardsResponse > map = response .get ();
@@ -836,7 +836,7 @@ public void onNodeDisconnected(DiscoveryNode node) {
836
836
837
837
//give transport service enough time to realize that the node is down, and to notify the connection listeners
838
838
//so that RemoteClusterConnection is left with no connected nodes, hence it will retry connecting next
839
- assertTrue (disconnectedLatch .await (1 , TimeUnit .SECONDS ));
839
+ assertTrue (disconnectedLatch .await (5 , TimeUnit .SECONDS ));
840
840
841
841
service .clearAllRules ();
842
842
if (randomBoolean ()) {
@@ -853,7 +853,7 @@ public void onNodeDisconnected(DiscoveryNode node) {
853
853
AtomicReference <Exception > failure = new AtomicReference <>();
854
854
remoteClusterService .collectSearchShards (IndicesOptions .lenientExpandOpen (), null , null , remoteIndicesByCluster ,
855
855
new LatchedActionListener <>(ActionListener .wrap (response ::set , failure ::set ), latch ));
856
- assertTrue (latch .await (1 , TimeUnit .SECONDS ));
856
+ assertTrue (latch .await (5 , TimeUnit .SECONDS ));
857
857
assertNull (failure .get ());
858
858
assertNotNull (response .get ());
859
859
Map <String , ClusterSearchShardsResponse > map = response .get ();
@@ -862,7 +862,7 @@ public void onNodeDisconnected(DiscoveryNode node) {
862
862
String clusterAlias = "remote" + i ;
863
863
assertTrue (map .containsKey (clusterAlias ));
864
864
ClusterSearchShardsResponse shardsResponse = map .get (clusterAlias );
865
- assertTrue ( shardsResponse != ClusterSearchShardsResponse .EMPTY );
865
+ assertNotSame ( ClusterSearchShardsResponse .EMPTY , shardsResponse );
866
866
}
867
867
}
868
868
assertEquals (0 , service .getConnectionManager ().size ());
0 commit comments