Skip to content

Commit

Permalink
move endTime to finally block
Browse files Browse the repository at this point in the history
Change-Id: I1d6c79c4cc0e0c188d0d5f1e6b5b486966f1bb43
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/283475
Reviewed-by: Brian Watson <[email protected]>
QA-Review: James Butters <[email protected]>
Product-Review: James Butters <[email protected]>
Tested-by: Service Cloud Jenkins <[email protected]>
  • Loading branch information
jbutte committed Jan 24, 2022
1 parent 0de47ab commit 313f4c2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Jenkinsfile.rspecq
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ def sendCrystalballMetrics(startTime, endTime) {
def exampleCount = sh(script: "docker run -e TEST_QUEUE_HOST -t --rm $REGISTRY_BASE/redis:alpine /bin/sh -c '\
redis-cli -h $TEST_QUEUE_HOST -p 6379 get ${JOB_NAME}_build${BUILD_NUMBER}_selenium:example_count'", returnStdout: true).replaceAll('"', '').trim()

def executionTime = (endTime - startTime)
print "========= endTime class: ${endTime.getClass()} \n============= executionTime: ${executionTime}"
reportToSplunk('selenium_crystalball_data', [
'node_count': rspecqNodeTotal,
'example_count': exampleCount.toInteger(),
Expand Down Expand Up @@ -208,7 +206,6 @@ pipeline {
--queue-wait-timeout 120 \
--redis-url $RSPECQ_REDIS_URL \
--report", label: 'Reporter')
endTime = System.currentTimeMillis()
} catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException e) {
if (e.causes[0] instanceof org.jenkinsci.plugins.workflow.steps.TimeoutStepExecution.ExceededTimeout) {
/* groovylint-disable-next-line GStringExpressionWithinString, SpaceInsideParentheses */
Expand All @@ -221,6 +218,8 @@ pipeline {
'''
}
throw e
} finally {
endTime = System.currentTimeMillis()
}
}

Expand Down

0 comments on commit 313f4c2

Please sign in to comment.