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

NullPointerException in hudson.plugins.testng.Publisher.locateReports

    Details

    • Similar Issues:

      Description

      If I run the build through Jenkins but only 1 at a time, the build is successful. If I run concurrent builds of the same project through Jenkins, I get a NullPointerException from the TestNG plugin.

      java.lang.NullPointerException
      at hudson.plugins.testng.Publisher.locateReports(Publisher.java:180)
      at hudson.plugins.testng.Publisher.perform(Publisher.java:105)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:776)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
      at hudson.model.Build$BuildExecution.post2(Build.java:183)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
      at hudson.model.Run.execute(Run.java:1763)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:381)

        Attachments

          Activity

          Hide
          nathanila Nathan Reynolds added a comment -

          Do you have enough information to resolve the bug? If not, what else do you need? I am using version 1.10 of the plugin.

          Line 180, the location of the NullPointerException, is this…

          FilePath src = workspace.child(path);

          It seems the only source of a NullPointerException is dereferencing the workspace variable. But, that doesn’t make any sense since workspace is dereferenced in line 170 and since it is a local variable it can't be changed by another thread. Am I looking at the right version of the source code?

          https://github.com/jenkinsci/testng-plugin-plugin/blob/testng-plugin-1.10/src/main/java/hudson/plugins/testng/Publisher.java

          What else could cause a NullPointerException on this line?

          Show
          nathanila Nathan Reynolds added a comment - Do you have enough information to resolve the bug? If not, what else do you need? I am using version 1.10 of the plugin. Line 180, the location of the NullPointerException, is this… FilePath src = workspace.child(path); It seems the only source of a NullPointerException is dereferencing the workspace variable. But, that doesn’t make any sense since workspace is dereferenced in line 170 and since it is a local variable it can't be changed by another thread. Am I looking at the right version of the source code? https://github.com/jenkinsci/testng-plugin-plugin/blob/testng-plugin-1.10/src/main/java/hudson/plugins/testng/Publisher.java What else could cause a NullPointerException on this line?
          Hide
          nathanila Nathan Reynolds added a comment -

          I missed the catch statement. If line 170 throws a NullPointerException, then the catch statement swallows the exception and then goes on to throw the NullPointerException at line 180. So, it seems like the caller is passing a null to Publisher.locateReports().

          Show
          nathanila Nathan Reynolds added a comment - I missed the catch statement. If line 170 throws a NullPointerException, then the catch statement swallows the exception and then goes on to throw the NullPointerException at line 180. So, it seems like the caller is passing a null to Publisher.locateReports().
          Hide
          nathanila Nathan Reynolds added a comment -

          So, looking at the caller, here's line 105.

          FilePath[] paths = locateReports(build.getWorkspace(), pathsPattern);

          The null must be coming from build.getWorkspace(). Why would build.getWorkspace() return null during a concurrent build and not an isolated build?

          Show
          nathanila Nathan Reynolds added a comment - So, looking at the caller, here's line 105. FilePath[] paths = locateReports(build.getWorkspace(), pathsPattern); The null must be coming from build.getWorkspace(). Why would build.getWorkspace() return null during a concurrent build and not an isolated build?
          Hide
          nullin Nalin Makar added a comment - - edited

          Doesn't look like a testng plugin issue. You should look at the source for the Jenkins version you have installed and check your job configuration. Also see JENKINS-5658 for similar issue.

          Show
          nullin Nalin Makar added a comment - - edited Doesn't look like a testng plugin issue. You should look at the source for the Jenkins version you have installed and check your job configuration. Also see JENKINS-5658 for similar issue.
          Hide
          nullin Nalin Makar added a comment -

          Can not reproduce and no activity for a long time.

          Show
          nullin Nalin Makar added a comment - Can not reproduce and no activity for a long time.

            People

            • Assignee:
              nullin Nalin Makar
              Reporter:
              nathanila Nathan Reynolds
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: