Skip to content

Commit

Permalink
Save duplicate REST client in ESRestTestCase (#117910)
Browse files Browse the repository at this point in the history
I debugged some tests today and noticed that these two clients
are the same in almost all cases, no need to use extra connections.
Might give usa small speedup for these tests that tend to be quite slow
relative to the node client based tests.
  • Loading branch information
original-brownbear authored Dec 5, 2024
1 parent 7070e95 commit 584918e
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,11 @@ public void initClient() throws IOException {
assert testFeatureServiceInitialized() == false;
clusterHosts = parseClusterHosts(getTestRestCluster());
logger.info("initializing REST clients against {}", clusterHosts);
client = buildClient(restClientSettings(), clusterHosts.toArray(new HttpHost[clusterHosts.size()]));
adminClient = buildClient(restAdminSettings(), clusterHosts.toArray(new HttpHost[clusterHosts.size()]));
var clientSettings = restClientSettings();
var adminSettings = restAdminSettings();
var hosts = clusterHosts.toArray(new HttpHost[0]);
client = buildClient(clientSettings, hosts);
adminClient = clientSettings.equals(adminSettings) ? client : buildClient(adminSettings, hosts);

availableFeatures = EnumSet.of(ProductFeature.LEGACY_TEMPLATES);
Set<String> versions = new HashSet<>();
Expand Down

0 comments on commit 584918e

Please sign in to comment.