cheets_CTS: Hack for avoiding FAILing results shown as WARN.

The command line pattern of the dEQP sub-tests does not seem
handled very well by tradefed in terms of retries. Showing a
failing result as passing is bad. Rather, for now, let us give
up the retry and exit as failing.

BUG=b:127908450
TEST=cheets_CTS_P.arm.9.0_r6.CtsDeqpTestCases.dEQP-EGL on caroline

Change-Id: I611b6d37e17e94cd639bf22e8b338ee8c20fdfaa
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/1522966
Tested-by: Kazuhiro Inaba <kinaba@chromium.org>
Commit-Queue: Kazuhiro Inaba <kinaba@chromium.org>
Trybot-Ready: Kazuhiro Inaba <kinaba@chromium.org>
Reviewed-by: Ilja H. Friedel <ihf@chromium.org>
(cherry picked from commit 1fc7a6d3f13e148fb15e03f1414afde1d56e51bd)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/1524384
Reviewed-by: Kazuhiro Inaba <kinaba@chromium.org>
diff --git a/server/cros/tradefed_test.py b/server/cros/tradefed_test.py
index 3f5f2ae..fc8f095 100644
--- a/server/cros/tradefed_test.py
+++ b/server/cros/tradefed_test.py
@@ -1120,6 +1120,13 @@
                 if failed <= waived and all_done:
                     break
 
+                # TODO(b/127908450) Tradefed loses track of not-executed tests
+                # when the commandline pattern included '*', and retry run for
+                # them wrongly declares all tests passed. This is misleading.
+                # Rather, we give up the retry and report the result as FAIL.
+                if not all_done and '*' in ''.join(run_template):
+                    break
+
         # Tradefed finished normally. Record the failures to perf.
         if target_module:
             # Only record the failure by module, which exclude 'all', 'collects-tests-only', etc.