Introduce a mechanism for retrying tests at the control file level.
If a test returns unsuccessfully and --retry-test > 0 is specified the test
will be rerun. Options were added to autoserv and are passed through to the
client side job by modifying the base_job.
Tests that fail and then succeed within the --retry-test limits will have a
test keyval set with the number of attempts |test_retries_before_success|.
--retry-test can be utilized immediately in run_remote_test but will need to
be piped through the RPC system and down to the scheduler to provide the proper
--retry-test value from the scheduler's perspective.
Fixed random pylint errors consisting mostly of unused imports.
TEST=unittests
created a randomly failing client and server side test and ran it on devices
BUG=chromium-os:37158
Change-Id: Ibec3935b5f6fd28fc1b6eb7be55de27a571ad777
Reviewed-on: https://gerrit.chromium.org/gerrit/42043
Commit-Queue: Scott Zawalski <scottz@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Tested-by: Scott Zawalski <scottz@chromium.org>
diff --git a/server/autoserv b/server/autoserv
index 3a917db..d54aac0 100755
--- a/server/autoserv
+++ b/server/autoserv
@@ -93,6 +93,7 @@
ssh_pass = parser.options.ssh_pass
collect_crashinfo = parser.options.collect_crashinfo
control_filename = parser.options.control_filename
+ test_retry = parser.options.test_retry
# can't be both a client and a server side test
if client and server:
@@ -134,7 +135,8 @@
kwargs['control_filename'] = control_filename
job = server_job.server_job(control, parser.args[1:], results, label,
user, machines, client, parse_job,
- ssh_user, ssh_port, ssh_pass, **kwargs)
+ ssh_user, ssh_port, ssh_pass, test_retry,
+ **kwargs)
job.logging.start_logging()
job.init_parser()