-
Bug
-
Resolution: Unresolved
-
Critical
-
latest 2.150
It appears that if you execute a function in stage and that function accesses a child node that has been form by parsing XML the stage will fail after the function is complete and successful
Example:
def xmlData = "" + "<data>" + "<parent>" + "<child>foo</child>" + "</parent>" + "</data>" + "" node() { stage( 'read' ) { echo "Testing nodeChildren" outputData() } } @NonCPS def getLatestXML() { echo "Before parsed" def data = new XmlSlurper().parseText(xmlData) echo "parsed " value = "${data.parent.child}-0.4.0-" echo "I can access value" + value.getClass() return value }def outputData () { def value = getLatestXML() echo "I can echo but I can't do anything with it" println "value: ${value}" }
This will fail with a java.io.NotSerializableException: groovy.util.slurpersupport.NodeChildren
even though the process was successful
This happens regardless if you use a seperate NonCPS or not.
And yes I did approve the scripts