jenkinsci / jenkinsci/junit-plugin

[JENKINS-5416] Wrong number of tests

Open
#854 4 comments 0 reactions 0 assignees View on GitHub
component:junit-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
87
Forks
351
Avg merge
1d 19h
Merged PRs (30d)
2

Description

Hi guys,

I discovered a bug in how hudson counts tests executed in a build (In my case this is a maven job but I don't know if the problem is the same for others types of jobs).

The problem is when in maven we launch in a module several executions of surefire.

For example I have a first surefire execution, exec1,with 4 tests and a second one, exec2, with 3 tests. In that case hudson will count exec1 results 2 times and will report 4+(4+3)=11 tests instead of 7.

This occurs with any number of surefire executions > 1. hudson will add for each execution the number of all tests executed and not the number of tests executed in the execution itself.

You can see the problem here :

http://builder.exoplatform.org/hudson/job/jcr-1.10.x-ci/org.exoplatform.jcr$exo.jcr.component.core/2377/testReport/

I have 2 executions (and before I had 5 that's why I didn't understand what happened), exec1=918 tests and exec2=1037 tests thus hudson reports 2873 tests (=918+(918+1037))

---
Originally reported by aheritier, imported from: Wrong number of tests


  • status: Open
  • priority: Major
  • component(s): junit-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 2
  • imported: 2025-11-26

Raw content of original issue

Hi guys,

I discovered a bug in how hudson counts tests executed in a build (In my case this is a maven job but I don't know if the problem is the same for others types of jobs).
The problem is when in maven we launch in a module several executions of surefire.
For example I have a first surefire execution, exec1,with 4 tests and a second one, exec2, with 3 tests. In that case hudson will count exec1 results 2 times and will report 4+(4+3)=11 tests instead of 7.
This occurs with any number of surefire executions > 1. hudson will add for each execution the number of all tests executed and not the number of tests executed in the execution itself.
You can see the problem here :
http://builder.exoplatform.org/hudson/job/jcr-1.10.x-ci/org.exoplatform.jcr$exo.jcr.component.core/2377/testReport/
I have 2 executions (and before I had 5 that's why I didn't understand what happened), exec1=918 tests and exec2=1037 tests thus hudson reports 2873 tests (=918+(918+1037))

Contributor guide

Open the contributing guide

Research direction

Start by reproducing a Maven module with multiple Surefire executions, using the examples in the issue. Then inspect the junit-plugin's test-result aggregation and verify that separate executions contribute only their own tests. Done means the 4-and-3 example reports 7 tests rather than 11, and the larger 918-and-1037 case reports 1955.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.