-
Bug
-
Resolution: Unresolved
-
Critical
-
None
-
Jenkins 2.170, workflow-cps-plugin 2.65
String test() { println("test") return "12345" } def testtest(String b = test()) { println("testtest") } testtest() println ("END")
This script produces the following:
[Pipeline] Start of Pipeline [Pipeline] echo test [Pipeline] echo END [Pipeline] End of Pipeline Finished: SUCCESS
the ' println("testtest")' is not invoked. Adding @NonCPS annotation is the available workaround:
@NonCPS String test() { println("test") return "12345" } def testtest(String b = test()) { println("testtest") } testtest() println ("END")
produces:
[Pipeline] Start of Pipeline (hide) [Pipeline] echo test [Pipeline] echo testtest [Pipeline] echo END [Pipeline] End of Pipeline Finished: SUCCESS
This doesn't look like a regression - it's reproduced in older versions as well.