Skip to content

Commit 33345d9

Browse files
authored
Delete flaky SettingsBasedHostProviderIT test (#34813)
testClusterFormsByScanningPorts is flaky: sometimes in CI it's not possible to bind to any of the ports we need to in order for the port scanning to work. This change removes this test, and #34809 describes a better way to test this behaviour.
1 parent 7340886 commit 33345d9

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

server/src/test/java/org/elasticsearch/discovery/zen/SettingsBasedHostProviderIT.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,14 @@
1919

2020
package org.elasticsearch.discovery.zen;
2121

22-
import org.apache.lucene.util.LuceneTestCase.AwaitsFix;
2322
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoRequest;
2423
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
2524
import org.elasticsearch.common.settings.Settings;
2625
import org.elasticsearch.test.ESIntegTestCase;
2726

2827
import static org.elasticsearch.discovery.DiscoveryModule.DISCOVERY_HOSTS_PROVIDER_SETTING;
2928
import static org.elasticsearch.discovery.zen.SettingsBasedHostsProvider.DISCOVERY_ZEN_PING_UNICAST_HOSTS_SETTING;
30-
import static org.elasticsearch.discovery.zen.SettingsBasedHostsProvider.LIMIT_LOCAL_PORTS_COUNT;
31-
import static org.elasticsearch.transport.TcpTransport.PORT;
3229

33-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/34781")
3430
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0, numClientNodes = 0)
3531
public class SettingsBasedHostProviderIT extends ESIntegTestCase {
3632

@@ -64,20 +60,4 @@ public void testClusterFormsWithSingleSeedHostInSettings() {
6460

6561
ensureStableCluster(extraNodes + 1);
6662
}
67-
68-
public void testClusterFormsByScanningPorts() {
69-
// This test will fail if all 4 ports just less than the one used by the first node are already bound by something else. It's hard
70-
// to know how often this might happen in reality, so let's try it and see.
71-
72-
final String seedNodeName = internalCluster().startNode();
73-
final NodesInfoResponse nodesInfoResponse
74-
= client(seedNodeName).admin().cluster().nodesInfo(new NodesInfoRequest("_local")).actionGet();
75-
final int seedNodePort = nodesInfoResponse.getNodes().get(0).getTransport().getAddress().publishAddress().getPort();
76-
final int minPort = randomIntBetween(seedNodePort - LIMIT_LOCAL_PORTS_COUNT + 1, seedNodePort - 1);
77-
final String portSpec = minPort + "-" + seedNodePort;
78-
79-
logger.info("--> using port specification [{}]", portSpec);
80-
internalCluster().startNode(Settings.builder().put(PORT.getKey(), portSpec));
81-
ensureStableCluster(2);
82-
}
8363
}

0 commit comments

Comments
 (0)