Skip to content

Commit e4eae46

Browse files
REST-Tests: Use Dedicated AntBuilders (#35576)
* REST-Tests: Use Dedicated AntBuilders * Use dedicated AntBuilder everywhere since AntBuilder is not threadsafe * Closes #33778
1 parent b2c6f31 commit e4eae46

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class ClusterFormationTasks {
137137
} else {
138138
dependsOn = startTasks.empty ? startDependencies : startTasks.get(0)
139139
writeConfigSetup = { Map esConfig ->
140-
String unicastTransportUri = node.config.unicastTransportUri(nodes.get(0), node, project.ant)
140+
String unicastTransportUri = node.config.unicastTransportUri(nodes.get(0), node, project.createAntBuilder())
141141
if (unicastTransportUri == null) {
142142
esConfig['discovery.zen.ping.unicast.hosts'] = []
143143
} else {
@@ -705,7 +705,7 @@ class ClusterFormationTasks {
705705
Collection<String> unicastHosts = new HashSet<>()
706706
nodes.forEach { node ->
707707
unicastHosts.addAll(node.config.otherUnicastHostAddresses.call())
708-
String unicastHost = node.config.unicastTransportUri(node, null, project.ant)
708+
String unicastHost = node.config.unicastTransportUri(node, null, project.createAntBuilder())
709709
if (unicastHost != null) {
710710
unicastHosts.addAll(Arrays.asList(unicastHost.split(",")))
711711
}
@@ -901,9 +901,10 @@ class ClusterFormationTasks {
901901
outputPrintStream: outputStream,
902902
messageOutputLevel: org.apache.tools.ant.Project.MSG_INFO)
903903

904-
project.ant.project.addBuildListener(listener)
905-
Object retVal = command(project.ant)
906-
project.ant.project.removeBuildListener(listener)
904+
AntBuilder ant = project.createAntBuilder()
905+
ant.project.addBuildListener(listener)
906+
Object retVal = command(ant)
907+
ant.project.removeBuildListener(listener)
907908
return retVal
908909
}
909910

0 commit comments

Comments
 (0)