Skip to content

Commit 56cac1b

Browse files
authored
Don't attempt to install modules into test cluster more than once (#121833)
1 parent 0cf42f2 commit 56cac1b

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
@@ -765,7 +765,12 @@ private void installModule(String moduleName, DefaultPluginInstallSpec installSp
765765

766766
});
767767

768-
IOUtils.syncMaybeWithLinks(modulePath, destination);
768+
// If we aren't overriding anything we can use links here, otherwise do a full copy
769+
if (installSpec.entitlementsOverride == null && installSpec.propertiesOverride == null) {
770+
IOUtils.syncMaybeWithLinks(modulePath, destination);
771+
} else {
772+
IOUtils.syncWithCopy(modulePath, destination);
773+
}
769774

770775
try {
771776
if (installSpec.entitlementsOverride != null) {
@@ -794,7 +799,9 @@ private void installModule(String moduleName, DefaultPluginInstallSpec installSp
794799
if (extendedProperty != null) {
795800
String[] extendedModules = extendedProperty.split(",");
796801
for (String module : extendedModules) {
797-
installModule(module, new DefaultPluginInstallSpec(), modulePaths);
802+
if (spec.getModules().containsKey(module) == false) {
803+
installModule(module, new DefaultPluginInstallSpec(), modulePaths);
804+
}
798805
}
799806
}
800807
} catch (IOException e) {

0 commit comments

Comments
 (0)