Fix timeout processing in CICD jobs
- default timeout increased from 1800 to 2400 sec because 'core'
component deployment takes more than 30 min now
- print the timeout message in run_jenkins_job.py to stdout along
with stderr
- do not fail get_jenkins_job_stages.py if info['result'] contains
'None' in cases when the job is failed by timeout. Wait for few
seconds, then report the workflow stages 'as is':
Create infrastructure: SUCCESS
Install core infrastructure: SUCCESS
Install infra: IN_PROGRESS
Change-Id: I2ca592a8f5069bb38ec7659f15eb72e4bfba1722
Closes-Bug:#PROD-23815
diff --git a/tcp_tests/utils/run_jenkins_job.py b/tcp_tests/utils/run_jenkins_job.py
index 00ebec6..b01f366 100755
--- a/tcp_tests/utils/run_jenkins_job.py
+++ b/tcp_tests/utils/run_jenkins_job.py
@@ -4,6 +4,7 @@
import os
import sys
+from devops import error
import json
sys.path.append(os.getcwd())
@@ -131,13 +132,18 @@
if opts.verbose:
print_build_header(build, job_params, opts)
- jenkins.wait_end_of_build(
- name=build[0],
- build_id=build[1],
- timeout=opts.build_timeout,
- interval=1,
- verbose=opts.verbose,
- job_output_prefix=opts.job_output_prefix)
+ try:
+ jenkins.wait_end_of_build(
+ name=build[0],
+ build_id=build[1],
+ timeout=opts.build_timeout,
+ interval=1,
+ verbose=opts.verbose,
+ job_output_prefix=opts.job_output_prefix)
+ except error.TimeoutError as e:
+ print(str(e))
+ raise
+
result = jenkins.build_info(name=build[0],
build_id=build[1])['result']
if opts.verbose: