[auotest] Add a new arg delay_minutes to delay suite job creating test jobs.
This allow provision jobs to be delayed after a suite job is created. It
helps the suite scheduler to distribute devserver load over the time.
Otherwise, suite jobs created together will kick off provision jobs
together and add a peak load on devservers.
Next change will be on suite_scheduler to add delay like 5 minutes apart
for suite jobs created in a single event handling, e.g., nightly.
BUG=chromium:582353
TEST=local run, unittest
./site_utils/run_suite.py -b veyron_jerry -i \
veyron_jerry-release/R50-7871.0.0 -s dummy --delay_minutes 5
Change-Id: I6aa9404dc33ba2f6b90556d6f783038d86aa402b
Reviewed-on: https://chromium-review.googlesource.com/328784
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
Reviewed-by: Dan Shi <dshi@google.com>
diff --git a/frontend/afe/site_rpc_interface.py b/frontend/afe/site_rpc_interface.py
index 7e2734a..821fcf4 100644
--- a/frontend/afe/site_rpc_interface.py
+++ b/frontend/afe/site_rpc_interface.py
@@ -128,7 +128,8 @@
suite_args=None, wait_for_results=True, job_retry=False,
max_retries=None, max_runtime_mins=None, suite_min_duts=0,
offload_failures_only=False, builds={},
- test_source_build=None, run_prod_code=False, **kwargs):
+ test_source_build=None, run_prod_code=False,
+ delay_minutes=0, **kwargs):
"""
Create a job to run a test suite on the given device with the given image.
@@ -175,6 +176,8 @@
lab servers. If False, the control files and test
code for this suite run will be retrieved from the
build artifacts.
+ @param delay_minutes: Delay the creation of test jobs for a given number of
+ minutes.
@param kwargs: extra keyword args. NOT USED.
@raises ControlFileNotFound: if a unique suite control file doesn't exist.
@@ -254,7 +257,8 @@
'max_runtime_mins': max_runtime_mins,
'offload_failures_only': offload_failures_only,
'test_source_build': test_source_build,
- 'run_prod_code': run_prod_code
+ 'run_prod_code': run_prod_code,
+ 'delay_minutes': delay_minutes,
}
control_file = tools.inject_vars(inject_dict, control_file)