Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install plugins in a single transaction in tests #51433

Merged
merged 1 commit into from
Jan 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -428,14 +428,27 @@ public synchronized void start() {

createConfiguration();

final List<String> pluginsToInstall = new ArrayList<>();
jasontedor marked this conversation as resolved.
Show resolved Hide resolved
if (plugins.isEmpty() == false) {
logToProcessStdout("Installing " + plugins.size() + " plugins");
plugins.forEach(plugin -> runElasticsearchBinScript("elasticsearch-plugin", "install", "--batch", plugin.toString()));
pluginsToInstall.addAll(plugins.stream().map(URI::toString).collect(Collectors.toList()));
}

if (getVersion().before("6.3.0") && testDistribution == TestDistribution.DEFAULT) {
LOGGER.info("emulating the {} flavor for {} by installing x-pack", testDistribution, getVersion());
runElasticsearchBinScript("elasticsearch-plugin", "install", "--batch", "x-pack");
logToProcessStdout("emulating the " + testDistribution + " flavor for " + getVersion() + " by installing x-pack");
pluginsToInstall.add("x-pack");
}

if (pluginsToInstall.isEmpty() == false) {
if (getVersion().onOrAfter("7.6.0")) {
logToProcessStdout("installing " + pluginsToInstall.size() + " plugins in a single transaction");
final String[] arguments = Stream.concat(Stream.of("install", "--batch"), pluginsToInstall.stream()).toArray(String[]::new);
runElasticsearchBinScript("elasticsearch-plugin", arguments);
logToProcessStdout("installed plugins");
} else {
logToProcessStdout("installing " + pluginsToInstall.size() + " plugins sequentially");
pluginsToInstall.forEach(plugin -> runElasticsearchBinScript("elasticsearch-plugin", "install", "--batch", plugin));
logToProcessStdout("installed plugins");
}
}

if (keystoreSettings.isEmpty() == false || keystoreFiles.isEmpty() == false) {
Expand Down