Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-48583

Junit test reports are dropped if they have a timestamp within the same second as another test report

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • junit-plugin
    • None

      The problem is in this line of code:

      https://github.com/jenkinsci/junit-plugin/blob/master/src/main/java/hudson/tasks/junit/TestResult.java#L297

      If two test reports have the same timestamp field, one of them is ignored.  However, those timestamp fields are only accurate to the second.  We parallelize our test runs and so occasionally two different files will have the same timestamp for a given job. 

      Our workaround is to add a unique number to the timestamp field.

          [JENKINS-48583] Junit test reports are dropped if they have a timestamp within the same second as another test report

          Jes Andersen added a comment -

          One thing to consider while is perhaps a log message about the file being ignored and why, since it took our team quite a bit of debugging to figure out this being the root cause.

          We got hit really badly by this since we ran it in parallel with msbuild where each project generated a xunit file and around half of the projects shared the timestamp with others.

          Jes Andersen added a comment - One thing to consider while is perhaps a log message about the file being ignored and why, since it took our team quite a bit of debugging to figure out this being the root cause. We got hit really badly by this since we ran it in parallel with msbuild where each project generated a xunit file and around half of the projects shared the timestamp with others.

          Kevin Neal added a comment -

          I've opened a PR to fix this issue:
          https://github.com/jenkinsci/junit-plugin/pull/120
          Builds are a bit backed up, but hopefully it will go through by tomorrow.

          sanaerosen albatros or anybody else, do you have time to review the PR to see if it will fix your use case?

          Kevin Neal added a comment - I've opened a PR to fix this issue: https://github.com/jenkinsci/junit-plugin/pull/120 Builds are a bit backed up, but hopefully it will go through by tomorrow. sanaerosen albatros or anybody else, do you have time to review the PR to see if it will fix your use case?

          Kevin Neal added a comment -

          Version 1.30 released today includes the fix

          Kevin Neal added a comment - Version 1.30 released today includes the fix

            khneal Kevin Neal
            sanaerosen Sanae Rosen
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: