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

Performance plugin can't find JMeter files for pipeline jobs using non-default glob

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: performance-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.50
      Performance plugin 2.2
    • Similar Issues:

      Description

      In a Jenknsfile, inside a node block, if try and specify the file like

       

       perfReport '/home/jenkins/workspace/sandbox/_out/jmeter.jtl'
      

      or

      performanceReport parsers: [[$class: 'JMeterParser', glob: '_out/jmeter.jtl']], relativeFailedThresholdNegative: 1.2, relativeFailedThresholdPositive: 1.89, relativeUnstableThresholdNegative: 1.8, relativeUnstableThresholdPositive: 1.5
      
      

       

      I get

       

      [Pipeline] End of Pipeline
      java.io.FileNotFoundException: /home/jenkins/workspace/sandbox/_out/jmeter.jtl (No such file or directory)
      	at java.io.FileInputStream.open0(Native Method)
      	at java.io.FileInputStream.open(FileInputStream.java:195)
      	at java.io.FileInputStream.<init>(FileInputStream.java:138)
      	at java.io.FileReader.<init>(FileReader.java:72)
      	at hudson.plugins.performance.parsers.ParserDetector.detect(ParserDetector.java:21)
      	at hudson.plugins.performance.parsers.ParserFactory.getParser(ParserFactory.java:26)
      

      I can

      sh 'cat _out/jmeter.jtl' 

      or ls it just fine, specifying the exact same path from the FileNotFoundException.

       I tried moving it to the root of the workspace, tried using ${WORKSPACE}, tried glob: '_out/*/.jtl

      What does work is performanceReport with the glob attribute removed, or set to the default */.jtl.   

      It generates this message: 

      Performance: Parsing JMeter report file '/var/jenkins_home/jobs/sandbox/builds/119/performance-reports/JMeter/jmeter.jtl'.

       

       

       

        Attachments

          Activity

          Hide
          artem_fedorov Artem Fedorov added a comment -

          I tried your experiment with the next slave workspaces:

          1) slave workspace: /home/artem/jenkins/slave/ 
          It's does not work, because this folder owner is user 'artem', but not 'jenkins'. In JMeter log i have the next message:

          /home/artem/jenkins/slave/workspace/SLAVE/jmeter.log log_file=jmeter.log java.io.FileNotFoundException: jmeter.log (Permission denied)

          Can you check owner of your jmeter log folder and find the same log message in your job log?

          2) When i change slave workspace to /var/lib/jenkins/slave/  it`s work.

           

          Show
          artem_fedorov Artem Fedorov added a comment - I tried your experiment with the next slave workspaces: 1) slave workspace: /home/artem/jenkins/slave/   It's does not work, because this folder owner is user 'artem', but not 'jenkins'. In JMeter log i have the next message: /home/artem/jenkins/slave/workspace/SLAVE/jmeter.log log_file=jmeter.log java.io.FileNotFoundException: jmeter.log (Permission denied) Can you check owner of your jmeter log folder and find the same log message in your job log? 2) When i change slave workspace to /var/lib/jenkins/slave/   it`s work.  
          Hide
          mstave mstave added a comment -

          You mean that with your slave configuration that the log file wasn't being created?

          Mine is definitely being created

           sh 'head _out/jmeter.log'

          I can see stuff.

          When you tried a slave - was it on a different system, that doesn't share a filesytem with the Jenkins Server?

          >When i change slave workspace to /var/lib/jenkins/slave/  it`s work.

          That is a path that's resolvable on the Jenkins server and on the Jenkins slave, since they're the same machine?

          My use case is a slave on a different system. 

          Is it not weird that in the stack trace it's showing code that uses workspace.withRemote() (and that code works) followed by new File(path returned from withRemote)?

          Show
          mstave mstave added a comment - You mean that with your slave configuration that the log file wasn't being created? Mine is definitely being created sh 'head _out/jmeter.log' I can see stuff. When you tried a slave - was it on a different system, that doesn't share a filesytem with the Jenkins Server? >When i change slave workspace to /var/lib/jenkins/slave/   it`s work. That is a path that's resolvable on the Jenkins server and on the Jenkins slave, since they're the same machine? My use case is a slave on a different system.  Is it not weird that in the stack trace it's showing code that uses workspace.withRemote() (and that code works) followed by new File(path returned from withRemote)?
          Hide
          undera Andrey Pokhilko added a comment -

          It was fixed with https://github.com/jenkinsci/performance-plugin/pull/97

          Can anybody please try the *.hpi snapshot from here https://jenkins.ci.cloudbees.com/job/plugins/job/performance-plugin/ws/target/ ?

          And let us know if finally fixes the issue.

          Show
          undera Andrey Pokhilko added a comment - It was fixed with https://github.com/jenkinsci/performance-plugin/pull/97 Can anybody please try the *.hpi snapshot from here https://jenkins.ci.cloudbees.com/job/plugins/job/performance-plugin/ws/target/  ? And let us know if finally fixes the issue.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Artem Fedorov
          Path:
          src/main/java/hudson/plugins/performance/PerformancePublisher.java
          src/main/java/hudson/plugins/performance/parsers/ParserFactory.java
          http://jenkins-ci.org/commit/performance-plugin/2d298b24e9761a8ff3d6e39c6f525f612f68829f
          Log:
          fixed 43438

          https://issues.jenkins-ci.org/browse/JENKINS-43438

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Artem Fedorov Path: src/main/java/hudson/plugins/performance/PerformancePublisher.java src/main/java/hudson/plugins/performance/parsers/ParserFactory.java http://jenkins-ci.org/commit/performance-plugin/2d298b24e9761a8ff3d6e39c6f525f612f68829f Log: fixed 43438 https://issues.jenkins-ci.org/browse/JENKINS-43438
          Hide
          artem_fedorov Artem Fedorov added a comment - - edited

          Fixed: copy report from slave
          https://github.com/jenkinsci/performance-plugin/pull/97
          Available since 3.0 version

          Show
          artem_fedorov Artem Fedorov added a comment - - edited Fixed: copy report from slave https://github.com/jenkinsci/performance-plugin/pull/97 Available since 3.0 version

            People

            • Assignee:
              artem_fedorov Artem Fedorov
              Reporter:
              mstave mstave
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: