Skip to content

Commit e6f4425

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 eaf010c commit e6f4425

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
@@ -140,7 +140,7 @@ class ClusterFormationTasks {
140140
} else {
141141
dependsOn = startTasks.empty ? startDependencies : startTasks.get(0)
142142
writeConfigSetup = { Map esConfig ->
143-
String unicastTransportUri = node.config.unicastTransportUri(nodes.get(0), node, project.ant)
143+
String unicastTransportUri = node.config.unicastTransportUri(nodes.get(0), node, project.createAntBuilder())
144144
if (unicastTransportUri == null) {
145145
esConfig['discovery.zen.ping.unicast.hosts'] = []
146146
} else {
@@ -717,7 +717,7 @@ class ClusterFormationTasks {
717717
Collection<String> unicastHosts = new HashSet<>()
718718
nodes.forEach { node ->
719719
unicastHosts.addAll(node.config.otherUnicastHostAddresses.call())
720-
String unicastHost = node.config.unicastTransportUri(node, null, project.ant)
720+
String unicastHost = node.config.unicastTransportUri(node, null, project.createAntBuilder())
721721
if (unicastHost != null) {
722722
unicastHosts.add(unicastHost)
723723
}
@@ -913,9 +913,10 @@ class ClusterFormationTasks {
913913
outputPrintStream: outputStream,
914914
messageOutputLevel: org.apache.tools.ant.Project.MSG_INFO)
915915

916-
project.ant.project.addBuildListener(listener)
917-
Object retVal = command(project.ant)
918-
project.ant.project.removeBuildListener(listener)
916+
AntBuilder ant = project.createAntBuilder()
917+
ant.project.addBuildListener(listener)
918+
Object retVal = command(ant)
919+
ant.project.removeBuildListener(listener)
919920
return retVal
920921
}
921922

0 commit comments

Comments
 (0)