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

Make build fail in case of timeout was cancelling the job

XMLWordPrintable

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

      The plugin does not make the build fail in case the configured timeout is hit.
      Most of our builds triggering Checkmarx-scans did not fail even though no successful scan was available in Checkmarx afterwards. This is due the scan being cancelled because the timeout is reached.

      A failed build including a log entry that the timeout made it cancel would be very helpful.
      We even involved the Checkmarx support to figure out the cause.

      Jenkins log of such a case (default timeout set 1 minute):

      ...
      ...
      09:42:41  [Cx-Debug]: ----------------------------------- Finish zipping files :------------------------------------
      09:42:41  [Cx-Info]: Uploading zip file
      09:42:41  [Cx-Info]: Sending SAST scan request
      09:42:41  [Cx-Info]: SAST Scan created successfully. Link to project state: https://********/projectState/*****/Summary
      09:42:41  [Cx-Info]: SAST scan created successfully: Scan ID is *****
      09:42:41  [Cx-Info]: ------------------------------------Get CxSAST Results:-----------------------------------
      09:42:41  [Cx-Info]: Waiting for CxSAST scan to finish.
      09:43:01  [Cx-Info]: Waiting for SAST scan results. Elapsed time: 00:00:20.  0% processed. Status: Queued.
      09:43:21  [Cx-Info]: Waiting for SAST scan results. Elapsed time: 00:00:40.  0% processed. Status: Scanning.
      09:43:42  [Cx-Info]: Copying file Report_CxSAST.html to workspace /home/jenkins/workspace/Misc/sast-scan/Checkmarx/Reports/Report_CxSAST.html
      

      Where a successful case looks like:

      ...
      ...
      02:15:50  [Cx-Debug]: ----------------------------------- Finish zipping files :------------------------------------
      02:15:50  [Cx-Info]: Uploading zip file
      02:15:50  [Cx-Info]: Sending SAST scan request
      02:15:50  [Cx-Info]: SAST Scan created successfully. Link to project state: https://*****/projectState/*****/Summary
      02:15:50  [Cx-Info]: SAST scan created successfully: Scan ID is *****
      02:15:50  [Cx-Info]: ------------------------------------Get CxSAST Results:-----------------------------------
      02:15:50  [Cx-Info]: Waiting for CxSAST scan to finish.
      02:16:10  [Cx-Info]: Waiting for SAST scan results. Elapsed time: 00:00:20.  0% processed. Status: Finished.
      02:16:10  [Cx-Info]: SAST scan finished successfully.
      02:16:10  [Cx-Info]: Retrieving SAST scan results
      02:16:20  [Cx-Info]: ----------------------------Checkmarx Scan Results(CxSAST):-------------------------------
      02:16:20  [Cx-Info]: High severity results: 0
      02:16:20  [Cx-Info]: Medium severity results: 0
      02:16:20  [Cx-Info]: Low severity results: 0
      02:16:20  [Cx-Info]: Information severity results: 0
      02:16:20  [Cx-Info]: 
      02:16:20  [Cx-Info]: Scan results location: https://*****/ViewerMain.aspx?scanId=****&ProjectID=**
      02:16:20  [Cx-Info]: ------------------------------------------------------------------------------------------
      02:16:20  
      02:16:20  [Cx-Info]: Generating PDF report
      02:16:30  [Cx-Info]: Copying file Report_CxSAST.html to workspace /home/jenkins/workspace/Misc/sast-scan/Checkmarx/Reports/Report_CxSAST.html
      02:16:30  [Cx-Info]: Copying file ScanReport.xml to workspace /home/jenkins/workspace/Misc/sast-scan/Checkmarx/Reports/ScanReport.xml
      

      I quickly looked at the source code but couldn't see how/where to fix it.
      Couldn't find the place where info exists about whether the timeout was reached...

            sergeyk Sergey Kadaner
            maecval Valentin Maechler
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: