[autotest] Re-list control files at the end of a suite
Re-listing the control files for the chosen build at the end of a suite
job allows us to verify that the dev sever is reporting them correctly
when the dynamic suite code first asks. Or, at least, that it's being
consistent. We've got some concerns about staging races.
Also, log all the control files that get run through the suite's
predicate, so taht we can diagnose issues like http://crosbug.com/30565
in the future.
BUG=chromium-os:30565
TEST=unit
TEST=run with the dev_harness, pointing at a local dev server.
TEST=Add a control file while autoserv is performing tests. The suite should fail.
Change-Id: Ic4fe4dbf2a2358c96e2badf4e3d52ca4f069697d
Reviewed-on: https://gerrit.chromium.org/gerrit/22156
Commit-Ready: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
diff --git a/server/cros/dynamic_suite.py b/server/cros/dynamic_suite.py
index d64c13d..e2e7aff 100644
--- a/server/cros/dynamic_suite.py
+++ b/server/cros/dynamic_suite.py
@@ -977,6 +977,9 @@
record(status, subdir, name, reason)
@param add_experimental: schedule experimental tests as well, or not.
"""
+ logging.debug('Discovered %d stable tests.', len(self.stable_tests()))
+ logging.debug('Discovered %d unstable tests.',
+ len(self.unstable_tests()))
try:
Status('INFO', 'Start %s' % self._tag).record_result(record)
self.schedule(add_experimental)
@@ -993,6 +996,14 @@
logging.error(traceback.format_exc())
Status('FAIL', self._tag,
'Exception while scheduling suite').record_result(record)
+ # Sanity check
+ tests_at_end = self.find_and_parse_tests(self._cf_getter,
+ self._predicate,
+ add_experimental=True)
+ if len(self.tests) != len(tests_at_end):
+ msg = 'Dev Server enumerated %d tests at start, %d at end.' % (
+ len(self.tests), len(tests_at_end))
+ Status('FAIL', self._tag, msg).record_result(record)
def schedule(self, add_experimental=True):
@@ -1106,10 +1117,11 @@
files = cf_getter.get_control_file_list()
matcher = re.compile(r'[^/]+/(deps|profilers)/.+')
for file in filter(lambda f: not matcher.match(f), files):
+ logging.debug('Considering %s', file)
text = cf_getter.get_control_file_contents(file)
try:
- found_test = control_data.parse_control_string(text,
- raise_warnings=True)
+ found_test = control_data.parse_control_string(
+ text, raise_warnings=True)
if not add_experimental and found_test.experimental:
continue