[autotest] Thread priority from create_suite_job through to create_job.
This schedules a suite job itself at the same priority level of its
tests, and also injects the priority value into the suite control files.
The change to thread priority through from dynamic_suite into create_job
needs to happen concurrently, because the type of `priority` is changing
from a string to an int. This also means everything that passes in a
priority gets fixed up in this CL.
suite_scheduler has also been tweaked to schedule all tests at the
PostBuild priority (for now...).
This also does all of the work to get priority to show up by name
instead of by integral value. In the create_job pane, we disallow
anyone to schedule a job at a priority that would preempt major build
processes (anything coming from a waterfall). However, all old jobs are
shown at the integral value, because showing two seperate priority
scales at the same time would be incredibly confusing. (Especially
since URGENT would be incredibly low priority)
BUG=chromium:250583
DEPLOY=afe, apache, suite_scheduler
TEST=unit, run_suite with a priority level
Change-Id: I9ecf5ceed5c58bd8ee0815c6d15f4aba300082fe
Reviewed-on: https://chromium-review.googlesource.com/168143
Reviewed-by: Alex Miller <milleral@chromium.org>
Tested-by: Alex Miller <milleral@chromium.org>
Commit-Queue: Alex Miller <milleral@chromium.org>
diff --git a/frontend/afe/site_rpc_interface.py b/frontend/afe/site_rpc_interface.py
index d2c6466..a6d5523 100644
--- a/frontend/afe/site_rpc_interface.py
+++ b/frontend/afe/site_rpc_interface.py
@@ -11,6 +11,7 @@
import logging
from autotest_lib.client.common_lib import error
+from autotest_lib.client.common_lib import priorities
from autotest_lib.client.common_lib.cros import dev_server
from autotest_lib.server.cros.dynamic_suite import constants
from autotest_lib.server.cros.dynamic_suite import control_file_getter
@@ -79,7 +80,8 @@
def create_suite_job(suite_name, board, build, pool, check_hosts=True,
- num=None, file_bugs=False):
+ num=None, file_bugs=False,
+ priority=priorities.Priority.DEFAULT):
"""
Create a job to run a test suite on the given device with the given image.
@@ -138,11 +140,12 @@
'pool': pool,
'num': num,
'file_bugs': file_bugs,
- 'devserver_url': ds.url()}
+ 'devserver_url': ds.url(),
+ 'priority': priority}
control_file = tools.inject_vars(inject_dict, control_file_in)
return _rpc_utils().create_job_common('%s-%s' % (build, suite_name),
- priority='Medium',
+ priority=priority,
control_type='Server',
control_file=control_file,
hostless=True,