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

FlakyTestResult doesn't catch NullPointerException

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I've observed `FlakyTestResult` throw `NullPointerException` when trying to process an empty xml file. The default junit plugin appends `.[empty]` to the test name and gives a message that the file was length 0 ([example here](http://build.osrfoundation.org/job/gazebo-ci-pr_any-homebrew-amd64_flaky/16/testReport/UNIT_ImagesView_TEST/xml/_empty_/)).

      ~~~
      Recording test results
      ERROR: Build step failed with exception
      java.lang.NullPointerException
      at java.io.File.<init>(File.java:277)
      at com.google.jenkins.flakyTestHandler.junit.FlakyTestResult.<init>(FlakyTestResult.java:120)
      at com.google.jenkins.flakyTestHandler.plugin.FlakyTestResultCollector.call(FlakyTestResultCollector.java:15)
      at com.google.jenkins.flakyTestHandler.plugin.FlakyTestResultCollector.call(FlakyTestResultCollector.java:7)
      ~~~

      I've submitted a [pull request](https://github.com/jenkinsci/flaky-test-handler-plugin/pull/4) to catch the exception. This allows the regular Junit publisher to handle the xml file and label it as empty.

        Attachments

          Activity

          Show
          scpeters Steve Peters added a comment - fixed by https://github.com/jenkinsci/flaky-test-handler-plugin/pull/4
          Hide
          typz Francois Ferrand added a comment -

          any plan for a release with this fix?
          Thanks!

          Show
          typz Francois Ferrand added a comment - any plan for a release with this fix? Thanks!
          Hide
          scpeters Steve Peters added a comment -

          I'd like to do so, but I need to learn how to do it first...

          Show
          scpeters Steve Peters added a comment - I'd like to do so, but I need to learn how to do it first...

            People

            Assignee:
            scpeters Steve Peters
            Reporter:
            scpeters Steve Peters
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: