Explorar el Código

REST-Tests: Use Dedicated AntBuilders (#35576)

* REST-Tests: Use Dedicated AntBuilders

* Use dedicated AntBuilder everywhere since AntBuilder is not threadsafe
* Closes #33778
Armin Braun hace 7 años
padre
commit
e6f4425e01

+ 6 - 5
buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy

@@ -140,7 +140,7 @@ class ClusterFormationTasks {
             } else {
                 dependsOn = startTasks.empty ? startDependencies : startTasks.get(0)
                 writeConfigSetup = { Map esConfig ->
-                    String unicastTransportUri = node.config.unicastTransportUri(nodes.get(0), node, project.ant)
+                    String unicastTransportUri = node.config.unicastTransportUri(nodes.get(0), node, project.createAntBuilder())
                     if (unicastTransportUri == null) {
                         esConfig['discovery.zen.ping.unicast.hosts'] = []
                     } else {
@@ -717,7 +717,7 @@ class ClusterFormationTasks {
             Collection<String> unicastHosts = new HashSet<>()
             nodes.forEach { node ->
                 unicastHosts.addAll(node.config.otherUnicastHostAddresses.call())
-                String unicastHost = node.config.unicastTransportUri(node, null, project.ant)
+                String unicastHost = node.config.unicastTransportUri(node, null, project.createAntBuilder())
                 if (unicastHost != null) {
                     unicastHosts.add(unicastHost)
                 }
@@ -913,9 +913,10 @@ class ClusterFormationTasks {
                 outputPrintStream: outputStream,
                 messageOutputLevel: org.apache.tools.ant.Project.MSG_INFO)
 
-        project.ant.project.addBuildListener(listener)
-        Object retVal = command(project.ant)
-        project.ant.project.removeBuildListener(listener)
+        AntBuilder ant = project.createAntBuilder()
+        ant.project.addBuildListener(listener)
+        Object retVal = command(ant)
+        ant.project.removeBuildListener(listener)
         return retVal
     }