NPE after upgrade to 1.53 when surefire report directory is empty
Version report
Jenkins and plugins versions report:
Jenkins: 2.303.1
OS: Linux - 3.10.0-1160.36.2.el7.x86_64
---
ace-editor:1.1
active-directory:2.24
allure-jenkins-plugin:2.29.0
analysis-model-api:10.3.0
ansicolor:1.0.0
ant:1.11
antisamy-markup-formatter:2.1
apache-httpcomponents-client-4-api:4.5.13-1.0
authentication-tokens:1.4
basic-branch-build-strategies:1.3.2
bitbucket:1.1.29
bitbucket-approval-filter:1.0.3
bitbucket-approve:1.0.3
blueocean:1.25.0
blueocean-autofavorite:1.2.4
blueocean-bitbucket-pipeline:1.25.0
blueocean-commons:1.25.0
blueocean-config:1.25.0
blueocean-core-js:1.25.0
blueocean-dashboard:1.25.0
blueocean-display-url:2.4.1
blueocean-events:1.25.0
blueocean-executor-info:1.25.0
blueocean-git-pipeline:1.25.0
blueocean-github-pipeline:1.25.0
blueocean-i18n:1.25.0
blueocean-jira:1.25.0
blueocean-jwt:1.25.0
blueocean-personalization:1.25.0
blueocean-pipeline-api-impl:1.25.0
blueocean-pipeline-editor:1.25.0
blueocean-pipeline-scm-api:1.25.0
blueocean-rest:1.25.0
blueocean-rest-impl:1.25.0
blueocean-web:1.25.0
bootstrap4-api:4.6.0-3
bootstrap5-api:5.1.1-1
bouncycastle-api:2.24
branch-api:2.6.5
build-pipeline-plugin:1.5.8
build-timeout:1.20
caffeine-api:2.9.2-29.v717aac953ff3
checks-api:1.7.2
chucknorris:1.4
cloudbees-bitbucket-branch-source:2.9.11
cloudbees-folder:6.16
cobertura:1.16
code-coverage-api:1.4.1
command-launcher:1.6
conditional-buildstep:1.4.1
config-autorefresh-plugin:1.0
config-file-provider:3.8.1
credentials:2.6.1
credentials-binding:1.27
custom-tools-plugin:0.8
cvs:2.19
data-tables-api:1.11.2-1
display-url-api:2.3.5
docker-commons:1.17
docker-workflow:1.26
durable-task:1.39
echarts-api:5.1.2-11
email-ext:2.83
extended-choice-parameter:0.82
external-monitor-job:1.7
extra-columns:1.24
favorite:2.3.3
font-awesome-api:5.15.4-1
forensics-api:1.3.0
git:4.8.2
git-client:3.9.0
git-parameter:0.9.13
git-server:1.10
github:1.34.1
github-api:1.123
github-branch-source:2.11.2
greenballs:1.15.1
h2-api:1.4.199
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-1.0
htmlpublisher:1.25
http_request:1.11
jackson2-api:2.12.4
jacoco:3.3.0
javadoc:1.6
jaxb:2.3.0.1
jdk-tool:1.5
jenkins-design-language:1.25.0
jira:3.6
jjwt-api:0.11.2-9.c8b45b8bb173
jquery:1.12.4-1
jquery-detached:1.2.1
jquery3-api:3.6.0-2
jsch:0.1.55.2
junit:1.52
junit-realtime-test-reporter:0.6
ldap:2.7
lockable-resources:2.11
mailer:1.34
mapdb-api:1.0.9.0
matrix-auth:2.6.8
matrix-project:1.19
maven-plugin:3.12
mercurial:2.15
momentjs:1.1.1
nodejs:1.4.0
okhttp-api:3.14.9
pam-auth:1.6
parameterized-trigger:2.41
pegdown-formatter:1.3
periodicbackup:1.6
permissive-script-security:0.6
pipeline-build-step:2.15
pipeline-graph-analysis:1.11
pipeline-input-step:2.12
pipeline-maven:3.10.0
pipeline-milestone-step:1.3.2
pipeline-model-api:1.9.2
pipeline-model-definition:1.9.2
pipeline-model-extensions:1.9.2
pipeline-rest-api:2.19
pipeline-stage-step:2.5
pipeline-stage-tags-metadata:1.9.2
pipeline-stage-view:2.19
pipeline-utility-steps:2.8.0
plain-credentials:1.7
plugin-util-api:2.4.0
popper-api:1.16.1-2
popper2-api:2.10.1-1
pubsub-light:1.16
rebuild:1.32
resource-disposer:0.16
run-condition:1.5
saferestart:0.3
scm-api:2.6.5
script-security:1.78
snakeyaml-api:1.29.1
sonar:2.13.1
sse-gateway:1.24
ssh-agent:1.23
ssh-credentials:1.19
ssh-slaves:1.33.0
sshd:3.1.0
stashNotifier:1.20
structs:1.23
test-results-analyzer:0.3.5
timestamper:1.13
token-macro:2.15
trilead-api:1.0.13
variant:1.4
view-job-filters:2.3
warnings-ng:9.5.0
windows-slaves:1.8
workflow-aggregator:2.6
workflow-api:2.46
workflow-basic-steps:2.24
workflow-cps:2.94
workflow-cps-global-lib:2.21
workflow-durable-task-step:2.39
workflow-job:2.41
workflow-multibranch:2.26
workflow-scm-step:2.13
workflow-step-api:2.24
workflow-support:3.8
ws-cleanup:0.39
- What Operating System are you using (both controller, and any agents involved in the problem)?
RHEL 7
Reproduction steps
- Running a build that produces an empty surefire report directory causes the following NPE (with version 1.53, version 1.52 is just fine):
[ERROR] java.lang.NullPointerException
at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:150)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3331)
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.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Results
Expected result: Build continues/succeeds as it does with version 1.52
Actual result: Build aborts with NPE (see above)
Also seeing this issue. Probably introduced by https://github.com/jenkinsci/junit-plugin/pull/292/files#diff-c921adc7a4606b0ec68dae39f857ea5cda930888809b7e9dfd0e90ac2395ade6R150. Question is what is null there, listener or listener.getLogger().
Also seeing this issue. Probably introduced by https://github.com/jenkinsci/junit-plugin/pull/292/files#diff-c921adc7a4606b0ec68dae39f857ea5cda930888809b7e9dfd0e90ac2395ade6R150. Question is what is
nullthere,listenerorlistener.getLogger().
The junit-realtime-test-reporter-plugin passes null for the listener: https://github.com/jenkinsci/junit-realtime-test-reporter-plugin/blob/master/src/main/java/org/jenkinsci/plugins/junitrealtimetestreporter/PipelineRealtimeTestResultAction.java#L74
Probably not the root cause for OP, but for us.