[workflow-plugin] no workspace for parallel steps

271 views
Skip to first unread message

Stefan Lorenz

unread,
Nov 19, 2014, 1:48:42 AM11/19/14
to jenkins...@googlegroups.com
Hi,

when I try to get the test results from parallel executed steps, I get the following exception, because there is no workspace for the steps to save the test results.

Zeichne Testergebnisse auf.
Running: Allocate workspace : Body : End
Running: Allocate workspace : End
Running: Allocate node : Body : End
Running: Allocate node : End
Running: Execute sub-workflows in parallel : Body : End
Running: Execute sub-workflows in parallel : End
Running: End of Workflow
org.jenkinsci.plugins.workflow.cps.steps.ParallelStepException: Parallel step suite4 failed
	at org.jenkinsci.plugins.workflow.cps.steps.ParallelStep$ResultHandler$Callback.checkAllDone(ParallelStep.java:126)
	at org.jenkinsci.plugins.workflow.cps.steps.ParallelStep$ResultHandler$Callback.onFailure(ParallelStep.java:105)
	at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution.onFailure(CpsBodyExecution.java:208)
	at org.jenkinsci.plugins.workflow.cps.BodyInvoker$FailureAdapter.receive(BodyInvoker.java:207)
	at com.cloudbees.groovy.cps.impl.ThrowBlock$1.receive(ThrowBlock.java:30)
	at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
	at com.cloudbees.groovy.cps.Next.step(Next.java:58)
	at com.cloudbees.groovy.cps.Next.run(Next.java:49)
	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:132)
	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:156)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:262)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:70)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:174)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:172)
	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:111)
	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: /home/jenkins/workspace/UITestStep@2 does not exist.
	at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:483)
	at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:460)
	at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:110)
	at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:92)
	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2665)
	at hudson.remoting.UserRequest.perform(UserRequest.java:121)
	at hudson.remoting.UserRequest.perform(UserRequest.java:49)
	at hudson.remoting.Request$2.run(Request.java:324)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
	at ......remote call to fc5fae789bf0@Docker (Native Method)
	at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1356)
	at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
	at hudson.remoting.Channel.call(Channel.java:752)
	at hudson.FilePath.act(FilePath.java:970)
	at hudson.FilePath.act(FilePath.java:959)
	at hudson.tasks.junit.JUnitParser.parseResult(JUnitParser.java:89)
	at hudson.tasks.junit.JUnitResultArchiver.parse(JUnitResultArchiver.java:120)
	at hudson.tasks.junit.JUnitResultArchiver.perform(JUnitResultArchiver.java:137)
	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:64)
	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:55)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:34)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:136)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:97)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:15)
	at WorkflowScript.run(WorkflowScript:40)
	at Unknown.Unknown(Unknown)
	at ___cps.transform___(Native Method)
	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:69)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:100)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:76)
	at sun.reflect.GeneratedMethodAccessor449.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
	at sun.reflect.GeneratedMethodAccessor450.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	... 18 more
Finished: FAILURE

James Nord

unread,
Nov 19, 2014, 6:34:44 AM11/19/14
to jenkins...@googlegroups.com
Could you paste a simple workflow that shows this?

From the log, to me it looks like your parallels are executed outside the node and workspace blocks.

Stefan Lorenz

unread,
Nov 19, 2014, 7:40:55 AM11/19/14
to jenkins...@googlegroups.com
stage 'UI-Test'
parallel(suite1: {
node('DockerBuild') {
ws {
catchError {
build  job: 'UITestSuiteRunner', parameters: [new hudson.model.StringParameterValue('mavenProfile', 'ui-test1'), new hudson.model.StringParameterValue('testSuite', 'UiTest1Suite')]
}
step $class: 'hudson.tasks.junit.JUnitResultArchiver', testResults: 'target/surefire-reports/*.xml'
}
}
}, suite2: {
node('DockerBuild') {
ws {
catchError {
build  job: 'UITestSuiteRunner', parameters: [new hudson.model.StringParameterValue('mavenProfile', 'ui-test2'), new hudson.model.StringParameterValue('testSuite', 'UiTest2Suite')]
}
step $class: 'hudson.tasks.junit.JUnitResultArchiver', testResults: 'target/surefire-reports/*.xml'
}
}
}, suite3: {
node('DockerBuild') {
ws {
catchError {
build  job: 'UITestSuiteRunner', parameters: [new hudson.model.StringParameterValue('mavenProfile', 'ui-test3'), new hudson.model.StringParameterValue('testSuite', 'UiTest3Suite')]
}
step $class: 'hudson.tasks.junit.JUnitResultArchiver', testResults: 'target/surefire-reports/*.xml'
}
}
},suite4: {
node('DockerBuild') {
ws {
catchError {
build  job: 'UITestSuiteRunner', parameters: [new hudson.model.StringParameterValue('mavenProfile', 'ui-test4'), new hudson.model.StringParameterValue('testSuite', 'UiTest4Suite')]
}
step $class: 'hudson.tasks.junit.JUnitResultArchiver', testResults: 'target/surefire-reports/*.xml'
}
}
})

James Nord

unread,
Nov 19, 2014, 10:52:27 AM11/19/14
to jenkins...@googlegroups.com
I can't obviously see why that would fail - however even if it worked it would not do what I think you expect it to do (copy the unit test results from the invoked job).

The test results need to come from the node&workspace that the workflow has used - however the 'build' step just triggers a regular jenkins job that is run outside of the node/workspace defeined by the flow.

Stefan Lorenz

unread,
Nov 19, 2014, 2:16:52 PM11/19/14
to jenkins...@googlegroups.com
Yeah, that's what I try to achive.

The job is a bit complex, with xfvb, a war deployment, and a maven project with a selenium test...
that's why I stared it with the "build" step... 

Isn't it possible to get the results from inside a "build" step? 

I recognized that the "build" step either has "failure" or "success" as result, never "unstable", even if the test results are "unstable".

Jesse Glick

unread,
Jan 8, 2015, 3:49:36 PM1/8/15
to jenkins...@googlegroups.com
On Wednesday, November 19, 2014 at 2:16:52 PM UTC-5, Stefan Lorenz wrote:
Isn't it possible to get the results from inside a "build" step?

Reply all
Reply to author
Forward
0 new messages