Autotest: Update RPC, Scheduler and AFE to use timeout_mins.
Now that timeout_mins is in the database, we need to update the
infrastructure to display and utilize timeout_mins rather than
timeout.
The scheduler now aborts based off of timeout_mins.
The afe displays/creates jobs using timeout_mins rather than timeout.
The RPC's take in timeout and timeout_min depending on what is inputted
to the system. Note the value supplied for timeout_mins takes precedence
over timeout.
BUG=chromium:221264
TEST=Created job through AFE, run_suite with smoke suite, job_unittest
and rpc_unittests.
DEPLOY=apache, afe, scheduler
CQ-DEPEND=I09f8b6023a31dcef37e98c298dc0d63b37bc0a9e
Change-Id: I838cd1ff85a2ce6bd49fe96bf18fd82be608c758
Reviewed-on: https://chromium-review.googlesource.com/176605
Reviewed-by: Simran Basi <[email protected]>
Commit-Queue: Simran Basi <[email protected]>
Tested-by: Simran Basi <[email protected]>
diff --git a/cli/job.py b/cli/job.py
index 3d4836a..ddf4e68 100644
--- a/cli/job.py
+++ b/cli/job.py
@@ -421,7 +421,8 @@
self.parser.add_option('-n', '--noverify',
help='Do not run verify for job',
default=False, action='store_true')
- self.parser.add_option('-o', '--timeout', help='Job timeout in hours.',
+ self.parser.add_option('-o', '--timeout_mins',
+ help='Job timeout in minutes.',
metavar='TIMEOUT')
self.parser.add_option('--max_runtime',
help='Job maximum runtime in minutes')
@@ -502,8 +503,8 @@
options.parse_failed_repair == 'true')
if options.noverify:
self.data['run_verify'] = False
- if options.timeout:
- self.data['timeout'] = options.timeout
+ if options.timeout_mins:
+ self.data['timeout_mins'] = options.timeout_mins
if options.max_runtime:
self.data['max_runtime_mins'] = options.max_runtime
diff --git a/cli/job_unittest.py b/cli/job_unittest.py
index c552fcf..34ef429 100755
--- a/cli/job_unittest.py
+++ b/cli/job_unittest.py
@@ -1053,10 +1053,10 @@
def test_execute_create_job_with_timeout(self):
data = self.data.copy()
- data['timeout'] = '222'
+ data['timeout_mins'] = '13320'
file_temp = cli_mock.create_file(self.ctrl_file)
self.run_cmd(argv=['atest', 'job', 'create', '-f', file_temp.name,
- 'test_job0', '-m', 'host0', '-o', '222',
+ 'test_job0', '-m', 'host0', '-o', '13320',
'--ignore_site_file'],
rpcs=[('create_job', data, True, 42)],
out_words_ok=['test_job0', 'Created'],)
@@ -1286,7 +1286,7 @@
'reboot_before': u'If dirty',
'run_verify': True,
'synch_count': 1,
- 'timeout': 480}
+ 'timeout_mins': 480}
local_hosts = [{u'acls': [u'acl0'],
u'atomic_group': None,