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

FlakyTestResult doesn't catch NullPointerException

XMLWordPrintable

      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.

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

              Created:
              Updated:
              Resolved: