do not combine control files with retries with specified as cli list

If multiple tests are specified from the command line, then if any of
them make use of RETRIES they will no longer be combined into a single
control file.

BUG=None
TEST=`run_remote_tests.sh --remote=172.22.75.104
^client/site_tests/dummy_Fail/control$
^client/site_tests/dummy_Pass/control.wifichaos$`
both tests run in combined control file

run_remote_tests.sh --remote=172.22.75.104
^client/site_tests/dummy_Fail/control$
^client/site_tests/dummy_Pass/control.wifichaos$
^client/tests/flaky_test/control$
All tests run in separate control files, since flaky_test uses RETRIES.

Change-Id: I1641ec19102542be1ca35679eb4d6d5d2a68ec1a
Reviewed-on: https://gerrit.chromium.org/gerrit/45802
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Aviv Keshet <akeshet@chromium.org>
diff --git a/run_remote_tests.sh b/run_remote_tests.sh
index bb25fd7..3174472 100755
--- a/run_remote_tests.sh
+++ b/run_remote_tests.sh
@@ -546,14 +546,20 @@
   if [[ -z ${FLAGS_profiler} ]]; then
     if [[ "$(echo ${control_files_to_run} | wc -w)" -gt 1 ]]; then
       # Check to make sure only client or only server control files have been
-      # requested, otherwise fall back to uncombined execution.
-      local control_type=$(check_control_file_types ${control_files_to_run})
+      # requested, and that none of the requested control files use retries.
+      # Otherwise fall back to uncombined execution.
+      local control_type retry_files
+      control_type=$(check_control_file_types ${control_files_to_run})
+      retry_files="$(get_nonzero_retry_control_files \
+                   ${control_files_to_run})"
       if [[ -n ${control_type} ]]; then
-        # Keep track of local control file for cleanup later.
-        new_control_file="$(generate_combined_control_file ${control_type} \
-            ${control_files_to_run})"
-        control_files_to_run="${new_control_file}"
-        echo ""
+        if [[ -z ${retry_files} ]]; then
+          # Keep track of local control file for cleanup later.
+          new_control_file="$(generate_combined_control_file ${control_type} \
+              ${control_files_to_run})"
+          control_files_to_run="${new_control_file}"
+          echo ""
+        fi
       fi
     fi
   fi