Skip to content

Commit 22f6f5e

Browse files
committed
[TEST] Increase TransportSearchActionTests timeouts
We have recently gone from 1 second to 5, and we still had some failures. Note that testCollectSearchShards was recently moved and reworked from RemoteClusterServiceTests to TransportSearchActionTests. Increasing this one last time considerably, which should help understanding if failures are caused by test infra slowness or a bug. Relates to elastic#33852
1 parent 1fa413a commit 22f6f5e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

server/src/test/java/org/elasticsearch/action/search/TransportSearchActionTests.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ public void onNodeDisconnected(DiscoveryNode node) {
548548

549549
//give transport service enough time to realize that the node is down, and to notify the connection listeners
550550
//so that RemoteClusterConnection is left with no connected nodes, hence it will retry connecting next
551-
assertTrue(disconnectedLatch.await(5, TimeUnit.SECONDS));
551+
assertTrue(disconnectedLatch.await(30, TimeUnit.SECONDS));
552552

553553
service.clearAllRules();
554554
if (randomBoolean()) {
@@ -610,7 +610,7 @@ public void testCollectSearchShards() throws Exception {
610610
TransportSearchAction.collectSearchShards(IndicesOptions.lenientExpandOpen(), null, null, skippedClusters,
611611
remoteIndicesByCluster, remoteClusterService, threadPool,
612612
new LatchedActionListener<>(ActionListener.wrap(response::set, e -> fail("no failures expected")), latch));
613-
awaitLatch(latch, 5, TimeUnit.SECONDS);
613+
awaitLatch(latch, 30, TimeUnit.SECONDS);
614614
assertEquals(0, skippedClusters.get());
615615
assertNotNull(response.get());
616616
Map<String, ClusterSearchShardsResponse> map = response.get();
@@ -629,7 +629,7 @@ public void testCollectSearchShards() throws Exception {
629629
TransportSearchAction.collectSearchShards(IndicesOptions.lenientExpandOpen(), "index_not_found", null, skippedClusters,
630630
remoteIndicesByCluster, remoteClusterService, threadPool,
631631
new LatchedActionListener<>(ActionListener.wrap(r -> fail("no response expected"), failure::set), latch));
632-
awaitLatch(latch, 5, TimeUnit.SECONDS);
632+
awaitLatch(latch, 30, TimeUnit.SECONDS);
633633
assertEquals(0, skippedClusters.get());
634634
assertNotNull(failure.get());
635635
assertThat(failure.get(), instanceOf(RemoteTransportException.class));
@@ -667,7 +667,7 @@ public void onNodeDisconnected(DiscoveryNode node) {
667667
TransportSearchAction.collectSearchShards(IndicesOptions.lenientExpandOpen(), null, null, skippedClusters,
668668
remoteIndicesByCluster, remoteClusterService, threadPool,
669669
new LatchedActionListener<>(ActionListener.wrap(r -> fail("no response expected"), failure::set), latch));
670-
awaitLatch(latch, 5, TimeUnit.SECONDS);
670+
awaitLatch(latch, 30, TimeUnit.SECONDS);
671671
assertEquals(0, skippedClusters.get());
672672
assertNotNull(failure.get());
673673
assertThat(failure.get(), instanceOf(RemoteTransportException.class));
@@ -687,7 +687,7 @@ public void onNodeDisconnected(DiscoveryNode node) {
687687
TransportSearchAction.collectSearchShards(IndicesOptions.lenientExpandOpen(), null, null, skippedClusters,
688688
remoteIndicesByCluster, remoteClusterService, threadPool,
689689
new LatchedActionListener<>(ActionListener.wrap(response::set, e -> fail("no failures expected")), latch));
690-
awaitLatch(latch, 5, TimeUnit.SECONDS);
690+
awaitLatch(latch, 30, TimeUnit.SECONDS);
691691
assertNotNull(response.get());
692692
Map<String, ClusterSearchShardsResponse> map = response.get();
693693
assertEquals(numClusters - disconnectedNodesIndices.size(), map.size());
@@ -704,7 +704,7 @@ public void onNodeDisconnected(DiscoveryNode node) {
704704

705705
//give transport service enough time to realize that the node is down, and to notify the connection listeners
706706
//so that RemoteClusterConnection is left with no connected nodes, hence it will retry connecting next
707-
assertTrue(disconnectedLatch.await(5, TimeUnit.SECONDS));
707+
assertTrue(disconnectedLatch.await(30, TimeUnit.SECONDS));
708708

709709
service.clearAllRules();
710710
if (randomBoolean()) {
@@ -722,7 +722,7 @@ public void onNodeDisconnected(DiscoveryNode node) {
722722
TransportSearchAction.collectSearchShards(IndicesOptions.lenientExpandOpen(), null, null, skippedClusters,
723723
remoteIndicesByCluster, remoteClusterService, threadPool,
724724
new LatchedActionListener<>(ActionListener.wrap(response::set, e -> fail("no failures expected")), latch));
725-
awaitLatch(latch, 5, TimeUnit.SECONDS);
725+
awaitLatch(latch, 30, TimeUnit.SECONDS);
726726
assertEquals(0, skippedClusters.get());
727727
assertNotNull(response.get());
728728
Map<String, ClusterSearchShardsResponse> map = response.get();

0 commit comments

Comments
 (0)