fix run_remote_tests.sh control file combining logic

This CL fixes a bug in the control file combining logic which was
causing tests to be run multiple times under some circumstances. It also
improves the logging messages in the preamble to a suite run.

BUG=chromium:224679
TEST=run_remote_tests.sh --remote=172.22.75.104 suite:dummyflake; 4
tests are run instead of 8.

Change-Id: If8ccaa0a03232cfb1d341fc9fb10b87daddd74c1
Reviewed-on: https://gerrit.chromium.org/gerrit/46785
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 600df5a..a111d3c 100755
--- a/run_remote_tests.sh
+++ b/run_remote_tests.sh
@@ -525,6 +525,9 @@
     suite_map[${suite}]="$(${ENUMERATOR_PATH}/suite_enumerator.py \
                  --autotest_dir="${AUTOTEST_DIR}" ${suite})" ||
         die "Cannot enumerate ${suite}"
+
+    info "Found $(echo ${suite_map[${suite}]} | wc -w) control files in suite."
+
     # Combine into a single control file if possible.
     control_type="$(check_control_file_types ${suite_map[${suite}]})"
 
@@ -534,20 +537,23 @@
     retry_files="$(get_nonzero_retry_control_files \
                       ${suite_map[${suite}]})"
 
-    info "Control type: ${control_type}"
     if [[ -n "${control_type}" ]]; then
+      info "Control type: ${control_type}"
       new_control_file="$(generate_combined_control_file ${control_type} \
                           ${nonretry_files})"
       suite_map[${suite}]="${new_control_file}"
+
+      if [[ -n "${retry_files}" ]]; then
+        info "Running the following control files that use RETRIES separately:"
+        for control_file in $retry_files; do
+          info "$control_file"
+        done
+        suite_map[${suite}]+=" ${retry_files}"
+      fi
+    else
+      info "Control type: mix of client and server"
     fi
 
-    if [[ -n "${retry_files}" ]]; then
-      info "Running the following control files that use RETRIES separately:"
-      for control_file in $retry_files; do
-        info "$control_file"
-      done
-      suite_map[${suite}]+=" ${retry_files}"
-    fi
   done