Skip to content

Commit 0b865d4

Browse files
authored
Don't attempt to install modules into test cluster more than once (#121833) (#121863)
(cherry picked from commit 56cac1b)
1 parent 28635f0 commit 0b865d4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/AbstractLocalClusterFactory.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,12 @@ private void installModule(String moduleName, DefaultPluginInstallSpec installSp
700700

701701
});
702702

703-
IOUtils.syncMaybeWithLinks(modulePath, destination);
703+
// If we aren't overriding anything we can use links here, otherwise do a full copy
704+
if (installSpec.entitlementsOverride == null && installSpec.propertiesOverride == null) {
705+
IOUtils.syncMaybeWithLinks(modulePath, destination);
706+
} else {
707+
IOUtils.syncWithCopy(modulePath, destination);
708+
}
704709

705710
try {
706711
if (installSpec.entitlementsOverride != null) {
@@ -729,7 +734,9 @@ private void installModule(String moduleName, DefaultPluginInstallSpec installSp
729734
if (extendedProperty != null) {
730735
String[] extendedModules = extendedProperty.split(",");
731736
for (String module : extendedModules) {
732-
installModule(module, new DefaultPluginInstallSpec(), modulePaths);
737+
if (spec.getModules().containsKey(module) == false) {
738+
installModule(module, new DefaultPluginInstallSpec(), modulePaths);
739+
}
733740
}
734741
}
735742
} catch (IOException e) {

0 commit comments

Comments
 (0)