jenkinsci / jenkinsci/workflow-basic-steps-plugin
[JENKINS-52578] retry clause causes multiplication
- Dominant language
- Java
- Stars
- 73
- Forks
- 129
- PR merge metrics
- No merged PRs in 30d
Description
Just discovered by accident, if a retry step happens, it produces some odd results:
def NuGetStore = "packages"
...
stage ('SonarQube') {
when { expression { Settings.Analyse } }
steps {
script {
retry(3) {
bat "${Tools.NuGet.Run} install -ExcludeVersion -Source \"${Tools.Sonar.Source}\" -OutputDirectory ${NuGetStore} ${Tools.Sonar.Package}"
Tools.Sonar.Run = new File (NuGetStore, Tools.Sonar.Run).toString()
bat "${Tools.Sonar.Run} ${Tools.Sonar.Version}"
}
}
}
}
with each retry pass it multiplies value of NuGetStore variable, see:

---
Originally reported by quas, imported from: retry clause causes multiplication
Raw content of original issue
Just discovered by accident, if a retry step happens, it produces some odd results:
def NuGetStore = "packages"
...
stage ('SonarQube') {
when { expression { Settings.Analyse } }
steps {
script {
retry(3) {
bat "${Tools.NuGet.Run} install -ExcludeVersion -Source \"${Tools.Sonar.Source}\" -OutputDirectory ${NuGetStore} ${Tools.Sonar.Package}"
Tools.Sonar.Run = new File (NuGetStore, Tools.Sonar.Run).toString()
bat "${Tools.Sonar.Run} ${Tools.Sonar.Version}"
}
}
}
}with each retry pass it multiplies value of NuGetStore variable, see:
1 attachment
- [image-2018-07-16-12-36-44-190.png](https://issues.jenkins.io/secure/attachment/43415/image-2018-07-16-12-36-44-190.png)
> 
Contributor guide
Assessment
This issue has not been assessed yet.