REST-Tests: Use Dedicated AntBuilders (#35576)

* REST-Tests: Use Dedicated AntBuilders

* Use dedicated AntBuilder everywhere since AntBuilder is not threadsafe
* Closes #33778
This commit is contained in:
Armin Braun 2018-11-15 14:23:28 +01:00 committed by GitHub
parent eaf010cd73
commit e6f4425e01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}