Skip to content

Commit 9f88d98

Browse files
committed
Don't attempt to install modules into test cluster more than once (elastic#121833)
(cherry picked from commit 56cac1b)
1 parent a635828 commit 9f88d98

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

750750
});
751751

752-
IOUtils.syncMaybeWithLinks(modulePath, destination);
752+
// If we aren't overriding anything we can use links here, otherwise do a full copy
753+
if (installSpec.entitlementsOverride == null && installSpec.propertiesOverride == null) {
754+
IOUtils.syncMaybeWithLinks(modulePath, destination);
755+
} else {
756+
IOUtils.syncWithCopy(modulePath, destination);
757+
}
753758

754759
try {
755760
if (installSpec.entitlementsOverride != null) {
@@ -778,7 +783,9 @@ private void installModule(String moduleName, DefaultPluginInstallSpec installSp
778783
if (extendedProperty != null) {
779784
String[] extendedModules = extendedProperty.split(",");
780785
for (String module : extendedModules) {
781-
installModule(module, new DefaultPluginInstallSpec(), modulePaths);
786+
if (spec.getModules().containsKey(module) == false) {
787+
installModule(module, new DefaultPluginInstallSpec(), modulePaths);
788+
}
782789
}
783790
}
784791
} catch (IOException e) {

0 commit comments

Comments
 (0)