Bug 1399024 - fix mainthreadio intermittents r=jmaher

MozReview-Commit-ID: 61Tn0AqbTbX

--HG--
extra : rebase_source : 13c25e6fb5bfaac95abd9271be4acb887fdb5786
This commit is contained in:
Ionut Goldan 2017-10-02 09:55:15 +03:00
Родитель 6360200002
Коммит d7f72fff74
3 изменённых файлов: 10 добавлений и 5 удалений

Просмотреть файл

@ -217,7 +217,6 @@ GLOBAL_OVERRIDES = (
'gecko_profile',
'gecko_profile_interval',
'gecko_profile_entries',
'mainthread',
'rss',
'shutdown',
'tpcycles',

Просмотреть файл

@ -51,6 +51,7 @@ NAME_SUBSTITUTIONS = OrderedDict([
(re.compile(r'{\w{8}-\w{4}-\w{4}-\w{4}-\w{12}}'), '{uuid}'),
(re.compile(r'{uuid}\.\d+\.ver\w+\.db'), '{uuid-db}')])
TUPLE_EVENT_SOURCE_INDEX = 1
TUPLE_FILENAME_INDEX = 2
WHITELIST_FILENAME = os.path.join(SCRIPT_DIR, 'mtio-whitelist.json')
@ -143,7 +144,8 @@ def main(argv):
wl = whitelist.Whitelist(test_name='mainthreadio',
paths={"{xre}": argv[3]},
path_substitutions=PATH_SUBSTITUTIONS,
name_substitutions=NAME_SUBSTITUTIONS)
name_substitutions=NAME_SUBSTITUTIONS,
event_sources=["PoisonIOInterposer"])
if not wl.load(WHITELIST_FILENAME):
print("Failed to load whitelist")
return 1
@ -155,7 +157,7 @@ def main(argv):
# Disabled until we enable TBPL oranges
# search for unknown filenames
errors = wl.check(data, TUPLE_FILENAME_INDEX)
errors = wl.check(data, TUPLE_FILENAME_INDEX, TUPLE_EVENT_SOURCE_INDEX)
if errors:
strs = wl.get_error_strings(errors)
wl.print_errors(strs)

Просмотреть файл

@ -19,7 +19,7 @@ class Whitelist:
PRE_PROFILE = ''
def __init__(self, test_name, paths, path_substitutions,
name_substitutions, init_with=None):
name_substitutions, event_sources=None, init_with=None):
self.test_name = test_name
self.listmap = init_with if init_with else {}
self.dependent_libs = self.load_dependent_libs() \
@ -27,6 +27,7 @@ class Whitelist:
self.paths = paths
self.path_substitutions = path_substitutions
self.name_substitutions = name_substitutions
self.expected_event_sources = event_sources or []
def load(self, filename):
if not self.load_dependent_libs():
@ -81,7 +82,7 @@ class Whitelist:
return filename.strip('/\\\ \t')
def check(self, test, file_name_index):
def check(self, test, file_name_index, event_source_index=None):
errors = {}
for row_key in test.iterkeys():
filename = self.sanitize_filename(row_key[file_name_index])
@ -92,6 +93,9 @@ class Whitelist:
continue
elif filename in self.dependent_libs:
continue
elif event_source_index is not None and \
test[event_source_index] in self.expected_event_sources:
continue
else:
if filename not in errors:
errors[filename] = []