Skip to content

Commit 24d0c9b

Browse files
authored
Remove transport client from tests. (#1809)
Transport client has been deprecated. In this commit, we are removing all its usages from the tests. Signed-off-by: Rabi Panda <adnapibar@gmail.com>
1 parent b00b45b commit 24d0c9b

File tree

73 files changed

+149
-2884
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+149
-2884
lines changed

modules/lang-mustache/src/internalClusterTest/java/org/opensearch/script/mustache/MultiSearchTemplateIT.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
6161
return Collections.singleton(MustachePlugin.class);
6262
}
6363

64-
@Override
65-
protected Collection<Class<? extends Plugin>> transportClientPlugins() {
66-
return nodePlugins();
67-
}
68-
6964
public void testBasic() throws Exception {
7065
createIndex("msearch");
7166
final int numDocs = randomIntBetween(10, 100);

modules/parent-join/src/internalClusterTest/java/org/opensearch/join/query/ParentChildTestCase.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
6363
return Arrays.asList(InternalSettingsPlugin.class, ParentJoinPlugin.class);
6464
}
6565

66-
@Override
67-
protected Collection<Class<? extends Plugin>> transportClientPlugins() {
68-
return nodePlugins();
69-
}
70-
7166
@Override
7267
public Settings indexSettings() {
7368
Settings.Builder builder = Settings.builder()

modules/rank-eval/src/internalClusterTest/java/org/opensearch/index/rankeval/RankEvalRequestIT.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ public class RankEvalRequestIT extends OpenSearchIntegTestCase {
6464
private static final String INDEX_ALIAS = "alias0";
6565
private static final int RELEVANT_RATING_1 = 1;
6666

67-
@Override
68-
protected Collection<Class<? extends Plugin>> transportClientPlugins() {
69-
return Arrays.asList(RankEvalPlugin.class);
70-
}
71-
7267
@Override
7368
protected Collection<Class<? extends Plugin>> nodePlugins() {
7469
return Arrays.asList(RankEvalPlugin.class);

modules/reindex/src/internalClusterTest/java/org/opensearch/client/documentation/ReindexDocumentationIT.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,6 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
9191
return Arrays.asList(ReindexPlugin.class, ReindexCancellationPlugin.class);
9292
}
9393

94-
@Override
95-
protected Collection<Class<? extends Plugin>> transportClientPlugins() {
96-
return Collections.singletonList(ReindexPlugin.class);
97-
}
98-
9994
@Before
10095
public void setup() {
10196
client().admin().indices().prepareCreate(INDEX_NAME).get();

modules/reindex/src/test/java/org/opensearch/index/reindex/ReindexTestCase.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
5454
return Arrays.asList(ReindexPlugin.class);
5555
}
5656

57-
@Override
58-
protected Collection<Class<? extends Plugin>> transportClientPlugins() {
59-
return Arrays.asList(ReindexPlugin.class);
60-
}
61-
6257
protected ReindexRequestBuilder reindex() {
6358
return new ReindexRequestBuilder(client(), ReindexAction.INSTANCE);
6459
}

modules/reindex/src/test/java/org/opensearch/index/reindex/RetryTests.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,6 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
8787
return Arrays.asList(ReindexPlugin.class, Netty4Plugin.class);
8888
}
8989

90-
@Override
91-
protected Collection<Class<? extends Plugin>> transportClientPlugins() {
92-
return Arrays.asList(ReindexPlugin.class, Netty4Plugin.class);
93-
}
94-
9590
/**
9691
* Lower the queue sizes to be small enough that bulk will time out and have to be retried.
9792
*/

modules/transport-netty4/src/internalClusterTest/java/org/opensearch/OpenSearchNetty4IntegTestCase.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,8 @@ protected Settings nodeSettings(int nodeOrdinal) {
6565
return builder.build();
6666
}
6767

68-
@Override
69-
protected Settings transportClientSettings() {
70-
Settings.Builder builder = Settings.builder().put(super.transportClientSettings());
71-
builder.put(NetworkModule.TRANSPORT_TYPE_KEY, Netty4Plugin.NETTY_TRANSPORT_NAME);
72-
return builder.build();
73-
}
74-
7568
@Override
7669
protected Collection<Class<? extends Plugin>> nodePlugins() {
7770
return Collections.singletonList(Netty4Plugin.class);
7871
}
79-
80-
@Override
81-
protected Collection<Class<? extends Plugin>> transportClientPlugins() {
82-
return Collections.singletonList(Netty4Plugin.class);
83-
}
8472
}

modules/transport-netty4/src/internalClusterTest/java/org/opensearch/http/netty4/Netty4HttpRequestSizeLimitIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
* As the same setting is also used to limit in-flight requests on transport level, we avoid transport messages by forcing
6161
* a single node "cluster". We also force test infrastructure to use the node client instead of the transport client for the same reason.
6262
*/
63-
@ClusterScope(scope = Scope.TEST, supportsDedicatedMasters = false, numClientNodes = 0, numDataNodes = 1, transportClientRatio = 0)
63+
@ClusterScope(scope = Scope.TEST, supportsDedicatedMasters = false, numClientNodes = 0, numDataNodes = 1)
6464
public class Netty4HttpRequestSizeLimitIT extends OpenSearchNetty4IntegTestCase {
6565

6666
private static final ByteSizeValue LIMIT = new ByteSizeValue(2, ByteSizeUnit.KB);

modules/transport-netty4/src/internalClusterTest/java/org/opensearch/rest/discovery/Zen2RestApiIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
// These tests are here today so they have access to a proper REST client. They cannot be in :server:integTest since the REST client needs a
6161
// proper transport implementation, and they cannot be REST tests today since they need to restart nodes. When #35599 and friends land we
6262
// should be able to move these tests to run against a proper cluster instead. TODO do this.
63-
@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.TEST, numDataNodes = 0, transportClientRatio = 0, autoManageMasterNodes = false)
63+
@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.TEST, numDataNodes = 0, autoManageMasterNodes = false)
6464
public class Zen2RestApiIT extends OpenSearchNetty4IntegTestCase {
6565

6666
@Override

modules/transport-netty4/src/internalClusterTest/java/org/opensearch/transport/netty4/Netty4TransportMultiPortIntegrationIT.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,17 @@
3232
package org.opensearch.transport.netty4;
3333

3434
import org.opensearch.OpenSearchNetty4IntegTestCase;
35-
import org.opensearch.action.admin.cluster.health.ClusterHealthResponse;
3635
import org.opensearch.action.admin.cluster.node.info.NodeInfo;
3736
import org.opensearch.action.admin.cluster.node.info.NodesInfoResponse;
38-
import org.opensearch.client.transport.TransportClient;
39-
import org.opensearch.cluster.health.ClusterHealthStatus;
4037
import org.opensearch.common.network.NetworkAddress;
41-
import org.opensearch.common.network.NetworkModule;
4238
import org.opensearch.common.settings.Settings;
4339
import org.opensearch.common.transport.BoundTransportAddress;
4440
import org.opensearch.common.transport.TransportAddress;
45-
import org.opensearch.env.Environment;
4641
import org.opensearch.test.OpenSearchIntegTestCase.ClusterScope;
4742
import org.opensearch.test.OpenSearchIntegTestCase.Scope;
4843
import org.opensearch.test.junit.annotations.Network;
49-
import org.opensearch.transport.MockTransportClient;
50-
import org.opensearch.transport.Netty4Plugin;
5144
import org.opensearch.transport.TransportInfo;
5245

53-
import java.net.InetAddress;
54-
import java.util.Arrays;
5546
import java.util.Locale;
5647

5748
import static org.opensearch.action.admin.cluster.node.info.NodesInfoRequest.Metric.TRANSPORT;
@@ -85,22 +76,6 @@ protected Settings nodeSettings(int nodeOrdinal) {
8576
return builder.build();
8677
}
8778

88-
public void testThatTransportClientCanConnect() throws Exception {
89-
Settings settings = Settings.builder()
90-
.put("cluster.name", internalCluster().getClusterName())
91-
.put(NetworkModule.TRANSPORT_TYPE_KEY, Netty4Plugin.NETTY_TRANSPORT_NAME)
92-
.put(Environment.PATH_HOME_SETTING.getKey(), createTempDir().toString())
93-
.build();
94-
// we have to test all the ports that the data node might be bound to
95-
try (TransportClient transportClient = new MockTransportClient(settings, Arrays.asList(Netty4Plugin.class))) {
96-
for (int i = 0; i <= 10; i++) {
97-
transportClient.addTransportAddress(new TransportAddress(InetAddress.getByName("127.0.0.1"), randomPort + i));
98-
}
99-
ClusterHealthResponse response = transportClient.admin().cluster().prepareHealth().get();
100-
assertThat(response.getStatus(), is(ClusterHealthStatus.GREEN));
101-
}
102-
}
103-
10479
@Network
10580
public void testThatInfosAreExposed() throws Exception {
10681
NodesInfoResponse response = client().admin().cluster().prepareNodesInfo().clear().addMetric(TRANSPORT.metricName()).get();

0 commit comments

Comments
 (0)