[autotest] monitor.db passes in test retry cli flag to autoserv

TEST=Ran dummyflake suite, and client side flake tests were retried
correctly when they failed. Server side flake test is not currently
working when run in a suite, for reasons unrelated to this CL.

Change-Id: If8134fe263bb33ee5d52bc92e78faee05388b239
Reviewed-on: https://gerrit.chromium.org/gerrit/44642
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Commit-Queue: Scott Zawalski <scottz@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Tested-by: Scott Zawalski <scottz@chromium.org>
diff --git a/scheduler/monitor_db.py b/scheduler/monitor_db.py
index 6f9999f..9d1eced 100755
--- a/scheduler/monitor_db.py
+++ b/scheduler/monitor_db.py
@@ -232,8 +232,8 @@
     @param machines - string - A machine or comma separated list of machines
             for the (-m) flag.
     @param extra_args - list - Additional arguments to pass to autoserv.
-    @param job - Job object - If supplied, -u owner and -l name parameters
-            will be added.
+    @param job - Job object - If supplied, -u owner, -l name, and --test-retry
+            parameters will be added.
     @param queue_entry - A HostQueueEntry object - If supplied and no Job
             object was supplied, this will be used to lookup the Job object.
@@ -245,6 +245,8 @@
         if not job:
             job = queue_entry.job
         autoserv_argv += ['-u', job.owner, '-l', job.name]
+        if job.test_retry:
+            autoserv_argv += ['--test-retry='+str(job.test_retry)]
     if verbose:
     return autoserv_argv + extra_args