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

Gatling Publisher skips reports if they are created immediately after the build starts

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • gatling-plugin
    • None

      Noticed it while creating tests in https://github.com/jenkinsci/gatling-plugin/pull/16 . "buildStartTime" is not as accurate as File modification time. In such case the comparison in https://github.com/jenkinsci/gatling-plugin/blob/master/src/main/java/io/gatling/jenkins/GatlingPublisher.java#L186 may return wrong value if the report file has been created when the build started

        private List<FilePath> selectReports(List<FilePath> reportFolders) throws InterruptedException, IOException {
          long buildStartTime = run.getStartTimeInMillis();
          List<FilePath> reportsFromThisBuild = new ArrayList<FilePath>();
          for (FilePath reportFolder : reportFolders) {
            long reportLastMod = reportFolder.lastModified();
      
            if (reportLastMod > buildStartTime) {
              logger.println("Adding report '" + reportFolder.getName() + "'");
              reportsFromThisBuild.add(reportFolder);
            }
          }
          return reportsFromThisBuild;
        }
      

            Unassigned Unassigned
            oleg_nenashev Oleg Nenashev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: