@@ -741,7 +741,7 @@ public void testCollectSearchShards() throws Exception {
741741 AtomicReference <Exception > failure = new AtomicReference <>();
742742 remoteClusterService .collectSearchShards (IndicesOptions .lenientExpandOpen (), null , null , remoteIndicesByCluster ,
743743 new LatchedActionListener <>(ActionListener .wrap (response ::set , failure ::set ), latch ));
744- assertTrue (latch .await (1 , TimeUnit .SECONDS ));
744+ assertTrue (latch .await (5 , TimeUnit .SECONDS ));
745745 assertNull (failure .get ());
746746 assertNotNull (response .get ());
747747 Map <String , ClusterSearchShardsResponse > map = response .get ();
@@ -760,7 +760,7 @@ public void testCollectSearchShards() throws Exception {
760760 remoteClusterService .collectSearchShards (IndicesOptions .lenientExpandOpen (), "index_not_found" ,
761761 null , remoteIndicesByCluster ,
762762 new LatchedActionListener <>(ActionListener .wrap (response ::set , failure ::set ), latch ));
763- assertTrue (latch .await (2 , TimeUnit .SECONDS ));
763+ assertTrue (latch .await (5 , TimeUnit .SECONDS ));
764764 assertNull (response .get ());
765765 assertNotNull (failure .get ());
766766 assertThat (failure .get (), instanceOf (RemoteTransportException .class ));
@@ -799,7 +799,7 @@ public void onNodeDisconnected(DiscoveryNode node) {
799799 AtomicReference <Exception > failure = new AtomicReference <>();
800800 remoteClusterService .collectSearchShards (IndicesOptions .lenientExpandOpen (), null , null , remoteIndicesByCluster ,
801801 new LatchedActionListener <>(ActionListener .wrap (response ::set , failure ::set ), latch ));
802- assertTrue (latch .await (1 , TimeUnit .SECONDS ));
802+ assertTrue (latch .await (5 , TimeUnit .SECONDS ));
803803 assertNull (response .get ());
804804 assertNotNull (failure .get ());
805805 assertThat (failure .get (), instanceOf (RemoteTransportException .class ));
@@ -817,7 +817,7 @@ public void onNodeDisconnected(DiscoveryNode node) {
817817 AtomicReference <Exception > failure = new AtomicReference <>();
818818 remoteClusterService .collectSearchShards (IndicesOptions .lenientExpandOpen (), null , null , remoteIndicesByCluster ,
819819 new LatchedActionListener <>(ActionListener .wrap (response ::set , failure ::set ), latch ));
820- assertTrue (latch .await (1 , TimeUnit .SECONDS ));
820+ assertTrue (latch .await (5 , TimeUnit .SECONDS ));
821821 assertNull (failure .get ());
822822 assertNotNull (response .get ());
823823 Map <String , ClusterSearchShardsResponse > map = response .get ();
@@ -836,7 +836,7 @@ public void onNodeDisconnected(DiscoveryNode node) {
836836
837837 //give transport service enough time to realize that the node is down, and to notify the connection listeners
838838 //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 ));
840840
841841 service .clearAllRules ();
842842 if (randomBoolean ()) {
@@ -853,7 +853,7 @@ public void onNodeDisconnected(DiscoveryNode node) {
853853 AtomicReference <Exception > failure = new AtomicReference <>();
854854 remoteClusterService .collectSearchShards (IndicesOptions .lenientExpandOpen (), null , null , remoteIndicesByCluster ,
855855 new LatchedActionListener <>(ActionListener .wrap (response ::set , failure ::set ), latch ));
856- assertTrue (latch .await (1 , TimeUnit .SECONDS ));
856+ assertTrue (latch .await (5 , TimeUnit .SECONDS ));
857857 assertNull (failure .get ());
858858 assertNotNull (response .get ());
859859 Map <String , ClusterSearchShardsResponse > map = response .get ();
@@ -862,7 +862,7 @@ public void onNodeDisconnected(DiscoveryNode node) {
862862 String clusterAlias = "remote" + i ;
863863 assertTrue (map .containsKey (clusterAlias ));
864864 ClusterSearchShardsResponse shardsResponse = map .get (clusterAlias );
865- assertTrue ( shardsResponse != ClusterSearchShardsResponse .EMPTY );
865+ assertNotSame ( ClusterSearchShardsResponse .EMPTY , shardsResponse );
866866 }
867867 }
868868 assertEquals (0 , service .getConnectionManager ().size ());
0 commit comments