Skip to content

Commit ca0f209

Browse files
Fix flaky test caused by unreliable remote cluster stalling
1 parent 713d874 commit ca0f209

File tree

3 files changed

+20
-22
lines changed

3 files changed

+20
-22
lines changed

muted-tests.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,6 @@ tests:
479479
- class: org.elasticsearch.xpack.esql.ccq.MultiClustersIT
480480
method: testLookupJoinAliasesSkipOld
481481
issue: https://github.com/elastic/elasticsearch/issues/131697
482-
- class: org.elasticsearch.indices.cluster.RemoteSearchForceConnectTimeoutIT
483-
method: testTimeoutSetting
484-
issue: https://github.com/elastic/elasticsearch/issues/131656
485482
- class: org.elasticsearch.xpack.stack.StackYamlIT
486483
method: test {yaml=stack/10_basic/Test wrong data_stream type - logs from 9.2.0}
487484
issue: https://github.com/elastic/elasticsearch/issues/131803
@@ -605,9 +602,6 @@ tests:
605602
- class: org.elasticsearch.index.mapper.vectors.DenseVectorFieldIndexTypeUpdateIT
606603
method: testDenseVectorMappingUpdate {initialType=int4_hnsw updateType=bbq_disk}
607604
issue: https://github.com/elastic/elasticsearch/issues/132165
608-
- class: org.elasticsearch.indices.cluster.FieldCapsForceConnectTimeoutIT
609-
method: testTimeoutSetting
610-
issue: https://github.com/elastic/elasticsearch/issues/132179
611605
- class: org.elasticsearch.index.mapper.vectors.DenseVectorFieldIndexTypeUpdateIT
612606
method: "testDenseVectorMappingUpdate {initialType=bbq_flat updateType=bbq_disk #2}"
613607
issue: https://github.com/elastic/elasticsearch/issues/132184

server/src/internalClusterTest/java/org/elasticsearch/indices/cluster/FieldCapsForceConnectTimeoutIT.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,23 @@ protected Map<String, Boolean> skipUnavailableForRemoteClusters() {
7373

7474
public void testTimeoutSetting() {
7575
var latch = new CountDownLatch(1);
76-
for (String nodeName : cluster(LOCAL_CLUSTER).getNodeNames()) {
77-
MockTransportService mts = (MockTransportService) cluster(LOCAL_CLUSTER).getInstance(TransportService.class, nodeName);
78-
79-
mts.addConnectBehavior(
80-
cluster(LINKED_CLUSTER_1).getInstance(TransportService.class, (String) null),
81-
((transport, discoveryNode, profile, listener) -> {
76+
for (String localNodeName : cluster(LOCAL_CLUSTER).getNodeNames()) {
77+
MockTransportService localMts = (MockTransportService) cluster(LOCAL_CLUSTER).getInstance(
78+
TransportService.class,
79+
localNodeName
80+
);
81+
for (String remoteNodeName : cluster(LINKED_CLUSTER_1).getNodeNames()) {
82+
TransportService remoteTs = cluster(LINKED_CLUSTER_1).getInstance(TransportService.class, remoteNodeName);
83+
localMts.addConnectBehavior(remoteTs, ((transport, discoveryNode, profile, listener) -> {
8284
try {
8385
latch.await();
8486
} catch (InterruptedException e) {
8587
throw new AssertionError(e);
8688
}
8789

8890
transport.openConnection(discoveryNode, profile, listener);
89-
})
90-
);
91+
}));
92+
}
9193
}
9294

9395
// Add some dummy data to prove we are communicating fine with the remote.

server/src/internalClusterTest/java/org/elasticsearch/indices/cluster/RemoteSearchForceConnectTimeoutIT.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,23 @@ protected Map<String, Boolean> skipUnavailableForRemoteClusters() {
7070

7171
public void testTimeoutSetting() {
7272
var latch = new CountDownLatch(1);
73-
for (String nodeName : cluster(LOCAL_CLUSTER).getNodeNames()) {
74-
MockTransportService mts = (MockTransportService) cluster(LOCAL_CLUSTER).getInstance(TransportService.class, nodeName);
75-
76-
mts.addConnectBehavior(
77-
cluster(REMOTE_CLUSTER_1).getInstance(TransportService.class, (String) null),
78-
((transport, discoveryNode, profile, listener) -> {
73+
for (String localNodeName : cluster(LOCAL_CLUSTER).getNodeNames()) {
74+
MockTransportService localMts = (MockTransportService) cluster(LOCAL_CLUSTER).getInstance(
75+
TransportService.class,
76+
localNodeName
77+
);
78+
for (String remoteNodeName : cluster(REMOTE_CLUSTER_1).getNodeNames()) {
79+
TransportService remoteTs = cluster(REMOTE_CLUSTER_1).getInstance(TransportService.class, remoteNodeName);
80+
localMts.addConnectBehavior(remoteTs, ((transport, discoveryNode, profile, listener) -> {
7981
try {
8082
latch.await();
8183
} catch (InterruptedException e) {
8284
throw new AssertionError(e);
8385
}
8486

8587
transport.openConnection(discoveryNode, profile, listener);
86-
})
87-
);
88+
}));
89+
}
8890
}
8991

9092
// Add some dummy data to prove we are communicating fine with the remote.

0 commit comments

Comments
 (0)