jenkinsci / jenkinsci/junit-plugin

[JENKINS-28490] jUnit discarding <testsuite> tags when certain attributes are equal

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

Description

The cause of this problem appears to be the `name` and `timestamp` attributes of a `` tag being equal. When processing the report file, if a `` tag is encountered where these attributes are the same as one that was already seen, the new tag is silently ignored.

This happens with the jUnit publisher and xUnit. It even happens if only the timestamps are equal, which is a nasty bug since timestamps shouldn't be used to uniquely identify a testsuite when they have different names. It looks like Jenkins publishes the first suite and ignores any other XML files with the same timestamp. If the timestamps are empty, they are all reported. Reproduced with Jenkins 1.595 with junit 1.2-beta4, and also reproduced with the latest Jenkins 1.627 and junit 1.8.

See the two attached test_result_*.xml to reproduce: Archive them via junit and only testFoo is reported. If you change the timestamp attribute of either, they both are reported.

---
Originally reported by myndzi, imported from: jUnit discarding tags when certain attributes are equal


  • status: Open
  • priority: Critical
  • component(s): junit-plugin, xunit-plugin
  • resolution: Unresolved
  • votes: 3
  • watchers: 7
  • imported: 2025-11-26

Raw content of original issue

The cause of this problem appears to be the `name` and `timestamp` attributes of a `<testsuite>` tag being equal. When processing the report file, if a `<testsuite>` tag is encountered where these attributes are the same as one that was already seen, the new tag is silently ignored.

This happens with the jUnit publisher and xUnit. It even happens if only the timestamps are equal, which is a nasty bug since timestamps shouldn't be used to uniquely identify a testsuite when they have different names. It looks like Jenkins publishes the first suite and ignores any other XML files with the same timestamp. If the timestamps are empty, they are all reported. Reproduced with Jenkins 1.595 with junit 1.2-beta4, and also reproduced with the latest Jenkins 1.627 and junit 1.8.

See the two attached test_result_*.xml to reproduce: Archive them via junit and only testFoo is reported. If you change the timestamp attribute of either, they both are reported.

environment

```
CentOS release 6.6 (Final)

Linux jenkins 2.6.32-504.16.2.el6.x86_64 #1 SMP Wed Apr 22 06:48:29 UTC 2015 x86

OpenJDK Runtime Environment (rhel-2.5.5.1.el6_6-x86_64 u79-b14)

OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)

Jenkins 1.611

xUnit plugin 1.96

jUnit plugin 1.6
```

6 attachments

- [build-123-input.xml](https://issues.jenkins.io/secure/attachment/29826/build-123-input.xml)
- [build-123-result.xml](https://issues.jenkins.io/secure/attachment/29825/build-123-result.xml)
- [build-124-input.xml](https://issues.jenkins.io/secure/attachment/29824/build-124-input.xml)
- [build-124-result.xml](https://issues.jenkins.io/secure/attachment/29823/build-124-result.xml)
- [test_result_1012678300206172099.xml](https://issues.jenkins.io/secure/attachment/30605/test_result_1012678300206172099.xml)
- [test_result_9114558122204227176.xml](https://issues.jenkins.io/secure/attachment/30604/test_result_9114558122204227176.xml)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.