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

Make checking for modification time of junit results be configurable and off by default

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • junit-plugin
    • None
    • 1119.va_a_5e9068da_d7

      The JUnit Result Archiver will fail the build if the test result files that match the filemask do not have a very recent modification time. The error message it prints is this:
      "Test reports were found but none of them are new. Did tests run?"

      This can be inconvenient in several settings; notably, when the clocks on the master and slave fall out of sync, or when the test results were generated by some process that isn't part of the build itself – maybe they were scp'd from somewhere else, for instance. Or for testing the JUnitResultArchiver itself.

      In my opinion, the behavior should be changed such that check-for-recent-modifications should be off by default. Additionally, the user should be able to specify a "recent" threshold via a setting.

          [JENKINS-6268] Make checking for modification time of junit results be configurable and off by default

          Mariano Cerdeiro added a comment - - edited

          Hi,

          @slawek Chaining the timestamp with touch is a workaround not a solution.

          In my opinion the best solution is to make this check configurable with 2 parameters, one configuration parameter to indicate if enable or disable and the second one if enable to indicate the maximal allowed timestamp difference.

          Mariano.-

          Mariano Cerdeiro added a comment - - edited Hi, @ slawek Chaining the timestamp with touch is a workaround not a solution. In my opinion the best solution is to make this check configurable with 2 parameters, one configuration parameter to indicate if enable or disable and the second one if enable to indicate the maximal allowed timestamp difference. Mariano.-

          I agree with mcerdeiro on the solution.

          I'm facing this issue when the code was not changed only configuration files that are not affecting the test.

          Attila Blenesi added a comment - I agree with mcerdeiro on the solution. I'm facing this issue when the code was not changed only configuration files that are not affecting the test.

          +1 for Mariano Cerdeiro's suggested solution. We've got builds failing because of 5 second differences.

          Kajsa Anderson added a comment - +1 for Mariano Cerdeiro's suggested solution. We've got builds failing because of 5 second differences.

          Gradle 4.0 moved build cache from incubating state to production. Build cache among other things caches JUnit test results, which results in continuous failures. It actually blocks our implementation of pipelines.

          Alex Dubrouski added a comment - Gradle 4.0 moved build cache from incubating state to production. Build cache among other things caches JUnit test results, which results in continuous failures. It actually blocks our implementation of pipelines.

          Justin McMillan added a comment - - edited

          I'm also blocked by this – I use a single Jenkins pipeline job to execute tests (across multiple environments – we want reporting on a per-environment level), and then another job executes which pulls those JUnit results into the workspace, and builds a report. I am encountering this on XMLs that are ~5 seconds "old".

           

          This Powershell script works, but still not the greatest:

          $files = Get-ChildItem "${WORKSPACE}"
            foreach ($i in $files) {
            $i.LastWriteTime = $(Get-Date)
          }
          

          Justin McMillan added a comment - - edited I'm also blocked by this – I use a single Jenkins pipeline job to execute tests (across multiple environments – we want reporting on a per-environment level), and then another job executes which pulls those JUnit results into the workspace, and builds a report. I am encountering this on XMLs that are ~5 seconds "old".   This Powershell script works, but still not the greatest: $files = Get-ChildItem "${WORKSPACE}" foreach ($i in $files) { $i.LastWriteTime = $(Get-Date) }

          Mike Kobit added a comment -

          Echoing what alex_dubrouski said, this totally breaks incremental builds from tools like Gradle.

          Mike Kobit added a comment - Echoing what alex_dubrouski said, this totally breaks incremental builds from tools like Gradle.

          Is there any progress on this? We are also hit by this, so currently we have only the option to disable junit recording at all...

          Christoph Läubrich added a comment - Is there any progress on this? We are also hit by this, so currently we have only the option to disable junit recording at all...

          Per Östman added a comment -

          This one is nine (9) years old. Come on, please fix this!

          Per Östman added a comment - This one is nine (9) years old. Come on, please fix this!

          Zak Taccardi added a comment -

          Note: I filed this too on GitHub which is related https://github.com/jenkinsci/junit-plugin/issues/201

          Zak Taccardi added a comment - Note: I filed this too on GitHub which is related  https://github.com/jenkinsci/junit-plugin/issues/201

          Basil Crow added a comment -

          Basil Crow added a comment - Fixed in jenkinsci/junit-plugin#384 . Released in 1119.va_a_5e9068da_d7 .

            olamy Olivier Lamy
            bshine bshine
            Votes:
            54 Vote for this issue
            Watchers:
            50 Start watching this issue

              Created:
              Updated:
              Resolved: