What Operating System are you using (both controller, and any agents involved in the problem)?
Docker image jenkins/jenkins:2.312-alpine
Reproduction steps
Run a build that produces an empty surefire report directory inside a realtimeJUnit block
Results
Expected result:
The build succeeds.
Actual result:
The build fails with the following output:
Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from [...]
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1795)
at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
at hudson.remoting.Channel.call(Channel.java:1001)
at hudson.FilePath.act(FilePath.java:1166)
at hudson.FilePath.act(FilePath.java:1155)
at hudson.tasks.junit.JUnitParser.parseResult(JUnitParser.java:107)
at hudson.tasks.junit.JUnitParser.parseResult(JUnitParser.java:100)
at org.jenkinsci.plugins.junitrealtimetestreporter.PipelineRealtimeTestResultAction.parse(PipelineRealtimeTestResultAction.java:74)
at org.jenkinsci.plugins.junitrealtimetestreporter.AbstractRealtimeTestResultAction.getResult(AbstractRealtimeTestResultAction.java:63)
at org.jenkinsci.plugins.junitrealtimetestreporter.RealtimeJUnitStep$Callback.finished(RealtimeJUnitStep.java:188)
at org.jenkinsci.plugins.junitrealtimetestreporter.RealtimeJUnitStep$Callback.onSuccess(RealtimeJUnitStep.java:165)
at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$SuccessAdapter.receive(CpsBodyExecution.java:377)
at com.cloudbees.groovy.cps.Outcome.resumeFrom(Outcome.java:73)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:166)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129)
at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268)
at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:400)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:312)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:276)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:150)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3326)
at hudson.remoting.UserRequest.perform(UserRequest.java:211)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:376)
at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:122)
at java.lang.Thread.run(Thread.java:748)
I tried to fix it myself, but I don't know where to get the TaskListener from inside the RunAction. If I pass it into the action from the RealtimeJUnitStep store it as a class variable, the tests fail, because the action can not be serialized. Can it be a transient field?
Version report
Jenkins and plugins versions report:
Reproduction steps
realtimeJUnit
blockResults
Expected result:
The build succeeds.
Actual result:
The build fails with the following output:
This issue has already been reported in https://github.com/jenkinsci/junit-plugin/issues/303, but I think it should be fixed here since the
JUnitParser
expects aTaskListener
since version 1.53 of the junit plug-in, but this plug-in passesnull
.I tried to fix it myself, but I don't know where to get the
TaskListener
from inside theRunAction
. If I pass it into the action from theRealtimeJUnitStep
store it as a class variable, the tests fail, because the action can not be serialized. Can it be atransient
field?