Bug 1423353 - Repush fix for xperf intermittents r?jmaher draft xperf_intermittent
authorIonut Goldan <igoldan@mozilla.com>
Tue, 09 Jan 2018 14:18:55 +0200
changeset 718547 3a1d4dbfc605badbf4c8ab5d694954f693c38983
parent 717738 6f5fac320fcb6625603fa8a744ffa8523f8b3d71
child 745513 69dcc5fe0c3821791cdfd412a26c054f0a74cc05
push id94958
push userbmo:igoldan@mozilla.com
push dateWed, 10 Jan 2018 13:17:48 +0000
reviewersjmaher
bugs1423353
milestone59.0a1
Bug 1423353 - Repush fix for xperf intermittents r?jmaher MozReview-Commit-ID: CEEPhr2SOND
testing/talos/talos/unittests/test_config.py
testing/talos/talos/unittests/test_xtalos/test_etlparser.py
testing/talos/talos/xtalos/etlparser.py
testing/talos/talos/xtalos/xperf_whitelist.json
--- a/testing/talos/talos/unittests/test_config.py
+++ b/testing/talos/talos/unittests/test_config.py
@@ -117,16 +117,19 @@ class Test_get_test(object):
 
 
 class Test_get_browser_config(object):
     required = ('preferences', 'extensions', 'browser_path', 'browser_wait',
                 'extra_args', 'buildid', 'env', 'init_url', 'webserver')
     optional = ['bcontroller_config',
                 'branch_name',
                 'child_process',
+                'debug',
+                'debugger',
+                'debugger_args',
                 'develop',
                 'e10s',
                 'process',
                 'framework',
                 'repository',
                 'sourcestamp',
                 'symbols_path',
                 'test_timeout',
@@ -171,17 +174,17 @@ class Test_get_browser_config(object):
     def test_browser_keys_are_subset_from_config(self):
         config_extensive = dict.fromkeys(self.required, '')
         config_extensive.update(dict.fromkeys(self.optional, ''))
         config_extensive['title'] = 'is_mandatory'
         config_extensive['extra_custom_key'] = 'value'
 
         browser_config = get_browser_config(config_extensive)
         assert browser_config != config_extensive
-        assert set(browser_config.keys()).issubset(set(config_extensive.keys()))
+        assert set(browser_config).issubset(set(config_extensive))
 
 
 class Test_get_config(object):
     @classmethod
     def setup_class(cls):
         cls.argv = '--suite other-e10s --mainthread -e /some/random/path'.split()
         cls.argv_unprovided_tests = '-e /some/random/path'.split()
         cls.argv_unknown_suite = '--suite random-unknown-suite -e /some/random/path'.split()
new file mode 100644
--- /dev/null
+++ b/testing/talos/talos/unittests/test_xtalos/test_etlparser.py
@@ -0,0 +1,64 @@
+from __future__ import absolute_import
+
+import re
+
+import mozunit
+
+from talos.xtalos.etlparser import NAME_SUBSTITUTIONS
+
+
+def test_NAME_SUBSTITUTIONS():
+    filepaths_map = {
+        # tp5n files
+        r'{talos}\talos\tests\tp5n\alibaba.com\i03.i.aliimg.com\images\eng\style\css_images':
+            r'{talos}\talos\tests\{tp5n_files}',
+        r'{talos}\talos\tests\tp5n\cnet.com\i.i.com.com\cnwk.1d\i\tron\fd':
+            r'{talos}\talos\tests\{tp5n_files}',
+        r'{talos}\talos\tests\tp5n\tp5n.manifest':
+            r'{talos}\talos\tests\{tp5n_files}',
+        r'{talos}\talos\tests\tp5n\tp5n.manifest.develop':
+            r'{talos}\talos\tests\{tp5n_files}',
+        r'{talos}\talos\tests\tp5n\yelp.com\media1.ct.yelpcdn.com\photo':
+            r'{talos}\talos\tests\{tp5n_files}',
+
+        # cltbld for Windows 7 32bit
+        r'c:\users\cltbld.t-w732-ix-015.000\appdata\locallow\mozilla':
+            r'c:\users\{cltbld}\appdata\locallow\mozilla',
+        r'c:\users\cltbld.t-w732-ix-035.000\appdata\locallow\mozilla':
+            r'c:\users\{cltbld}\appdata\locallow\mozilla',
+        r'c:\users\cltbld.t-w732-ix-058.000\appdata\locallow\mozilla':
+            r'c:\users\{cltbld}\appdata\locallow\mozilla',
+        r'c:\users\cltbld.t-w732-ix-112.001\appdata\local\temp':
+            r'c:\users\{cltbld}\appdata\local\temp',
+
+        # nvidia's 3D Vision
+        r'c:\program files\nvidia corporation\3d vision\npnv3dv.dll':
+            r'c:\program files\{nvidia_3d_vision}',
+        r'c:\program files\nvidia corporation\3d vision\npnv3dvstreaming.dll':
+            r'c:\program files\{nvidia_3d_vision}',
+        r'c:\program files\nvidia corporation\3d vision\nvstereoapii.dll':
+            r'c:\program files\{nvidia_3d_vision}',
+
+        r'{firefox}\browser\extensions\{45b6d270-f6ec-4930-a6ad-14bac5ea2204}.xpi':
+            r'{firefox}\browser\extensions\{uuid}.xpi',
+
+        r'c:\slave\test\build\venv\lib\site-packages\pip\_vendor\html5lib\treebuilders':
+            r'c:\slave\test\build\venv\lib\site-packages\{pip_vendor}',
+        r'c:\slave\test\build\venv\lib\site-packages\pip\_vendor\colorama':
+            r'c:\slave\test\build\venv\lib\site-packages\{pip_vendor}',
+        r'c:\slave\test\build\venv\lib\site-packages\pip\_vendor\cachecontrol\caches':
+            r'c:\slave\test\build\venv\lib\site-packages\{pip_vendor}',
+        r'c:\slave\test\build\venv\lib\site-packages\pip\_vendor\requests\packages\urllib3'
+        r'\packages\ssl_match_hostname':
+            r'c:\slave\test\build\venv\lib\site-packages\{pip_vendor}',
+    }
+
+    for given_raw_path, exp_normal_path in filepaths_map.items():
+        normal_path = given_raw_path
+        for pattern, substitution in NAME_SUBSTITUTIONS:
+            normal_path = re.sub(pattern, substitution, normal_path)
+        assert exp_normal_path == normal_path
+
+
+if __name__ == '__main__':
+    mozunit.main()
--- a/testing/talos/talos/xtalos/etlparser.py
+++ b/testing/talos/talos/xtalos/etlparser.py
@@ -24,17 +24,26 @@ FNAME_COL = "FileName"
 IMAGEFUNC_COL = "Image!Function"
 EVENTGUID_COL = "EventGuid"
 ACTIVITY_ID_COL = "etw:ActivityId"
 NUMBYTES_COL = "NumBytes"
 
 CEVT_WINDOWS_RESTORED = "{917b96b1-ecad-4dab-a760-8d49027748ae}"
 CEVT_XPCOM_SHUTDOWN = "{26d1e091-0ae7-4f49-a554-4214445c505c}"
 NAME_SUBSTITUTIONS = [
-    (re.compile(r'{\w{8}-\w{4}-\w{4}-\w{4}-\w{12}}'), '{uuid}')
+    # Careful with your regex!
+    # Substitution happens after combinations like \t \s \n ... are replaced
+    # with their real representations. So, prepend them with extra backslash.
+    # Read more: https://docs.python.org/2.7/library/re.html#re.sub
+    (re.compile(r'{\w{8}-\w{4}-\w{4}-\w{4}-\w{12}}'), '{uuid}'),
+    (re.compile(r'talos\\tests\\tp5n\\.*'), r'talos\\tests\{tp5n_files}'),
+    (re.compile(r'nvidia corporation\\3d vision\\.*'), '{nvidia_3d_vision}'),
+    (re.compile(r'cltbld\.t-w732-ix-\d+\.\d+'), '{cltbld}'),
+    (re.compile(r'venv\\lib\\site-packages\\pip\\_vendor\\.*'),
+     r'venv\lib\\site-packages\\{pip_vendor}'),
 ]
 stages = ["startup", "normal", "shutdown"]
 net_events = {
     "TcpDataTransferReceive": "recv",
     "UdpEndpointReceiveMessages": "recv",
     "TcpDataTransferSend": "send",
     "UdpEndpointSendMessages": "send"
 }
@@ -363,29 +372,29 @@ def etlparser(xperf_path, etl_filename, 
     if outputFile:
         # close the file handle
         outFile.close()
         if debug:
             uploadFile(outputFile)
 
     # We still like to have the outputfile to record the raw data, now
     # filter out acceptable files/ranges
-    filename = None
+    whitelist_path = None
     wl_temp = {}
     dirname = os.path.dirname(__file__)
     if os.path.exists(os.path.join(dirname, 'xperf_whitelist.json')):
-        filename = os.path.join(dirname, 'xperf_whitelist.json')
+        whitelist_path = os.path.join(dirname, 'xperf_whitelist.json')
     elif os.path.exists(os.path.join(dirname, 'xtalos')) and \
             os.path.exists(os.path.join(dirname, 'xtalos',
                                         'xperf_whitelist.json')):
-        filename = os.path.join(dirname, 'xtalos', 'xperf_whitelist.json')
+        whitelist_path = os.path.join(dirname, 'xtalos', 'xperf_whitelist.json')
 
     wl_temp = {}
-    if filename:
-        with open(filename, 'r') as fHandle:
+    if whitelist_path:
+        with open(whitelist_path, 'r') as fHandle:
             wl_temp = json.load(fHandle)
 
     # Approot is the full path where the application is located at
     # We depend on it for dependentlibs.list to ignore files required for
     # normal startup.
     if approot:
         if os.path.exists('%s\\dependentlibs.list' % approot):
             with open('%s\\dependentlibs.list' % approot, 'r') as fhandle:
@@ -397,17 +406,17 @@ def etlparser(xperf_path, etl_filename, 
     # Windows isn't case sensitive, this protects us against mismatched
     # systems.
     wl = {}
     for item in wl_temp:
         wl[item.lower()] = wl_temp[item]
 
     errors = []
     for row in filekeys:
-        filename = row[0]
+        filename = original_filename = row[0]
         filename = filename.lower()
         # take care of 'program files (x86)' matching 'program files'
         filename = filename.replace(" (x86)", '')
 
         paths = ['profile', 'firefox', 'desktop', 'talos']
         for path in paths:
             pathname = '%s\\' % path
             parts = filename.split(pathname)
@@ -460,20 +469,21 @@ def etlparser(xperf_path, etl_filename, 
 #            elif wl[filename]['maxcount'] < (files[row]['DiskReadCount'] +\
 #                   files[row]['DiskWriteCount']):
 #                errors.append("%s: %s accesses, more than expected maximum:"
 #                              " %s"
 #                              % (filename, (files[row]['DiskReadCount'] +
 #                                            files[row]['DiskWriteCount']),
 #                                 wl[filename]['maxcount']))
         else:
-            errors.append("File '%s' was accessed and we were not expecting"
+            errors.append("File '%s' (normalized from '%s') was accessed and we were not expecting"
                           " it.  DiskReadCount: %s, DiskWriteCount: %s,"
                           " DiskReadBytes: %s, DiskWriteBytes: %s"
                           % (filename,
+                             original_filename,
                              files[row]['DiskReadCount'],
                              files[row]['DiskWriteCount'],
                              files[row]['DiskReadBytes'],
                              files[row]['DiskWriteBytes']))
 
     if errors:
         # output specific errors to be picked up by tbpl parser
         for error in errors:
--- a/testing/talos/talos/xtalos/xperf_whitelist.json
+++ b/testing/talos/talos/xtalos/xperf_whitelist.json
@@ -1,108 +1,183 @@
 {
-  "C:\\$Extend\\$UsnJrnl:$J": {
-    "ignore": true
+  "\\fi_unknown": {
+    "mincount": 0,
+    "maxcount": 2,
+    "minbytes": 0,
+    "maxbytes": 8192
   },
-  "C:\\$Mft": {
+  "c:\\$extend\\$usnjrnl:$j": {
     "ignore": true
   },
-  "C:\\$Secure": {
+  "c:\\$logfile": {
     "ignore": true
   },
-  "C:\\$logfile": {
+  "c:\\$mft": {
     "ignore": true
   },
-  "Z:\\$logfile": {
-    "ignore": true
-  },
-  "C:\\Windows\\Prefetch\\{prefetch}.pf": {
+  "c:\\$secure": {
     "ignore": true
   },
   "c:\\program files\\desktop.ini": {
     "mincount": 2,
     "maxcount": 2,
     "minbytes": 352,
     "maxbytes": 352
   },
-  "c:\\program files\\nvidia corporation\\3d vision\\nvstereoapii.dll": {
+  "c:\\program files\\{nvidia_3d_vision}": {
     "mincount": 0,
-    "maxcount": 4,
-    "minbytes": 2,
-    "maxbytes": 33792
+    "maxcount": 24,
+    "minbytes": 0,
+    "maxbytes": 578560
   },
   "c:\\programdata\\nvidia corporation\\drs\\nvapptimestamps": {
     "mincount": 22,
     "maxcount": 22,
     "minbytes": 704,
     "maxbytes": 704
   },
   "c:\\programdata\\nvidia corporation\\drs\\nvdrssel.bin": {
     "mincount": 2,
     "maxcount": 2,
     "minbytes": 2,
     "maxbytes": 2
   },
+  "c:\\slave\\test\\build\\venv\\lib\\site-packages\\{pip_vendor}": {
+    "ignore": true
+  },
+  "c:\\users\\{cltbld}\\appdata\\locallow\\mozilla": {
+    "mincount": 0,
+    "maxcount": 8,
+    "minbytes": 0,
+    "maxbytes": 32768
+  },
   "c:\\users\\desktop.ini": {
     "mincount": 2,
     "maxcount": 2,
     "minbytes": 352,
     "maxbytes": 352
   },
+  "c:\\windows\\fonts\\segoeuii.ttf": {
+    "mincount": 0,
+    "maxcount": 4,
+    "minbytes": 0,
+    "maxbytes": 90112
+  },
   "c:\\windows\\fonts\\staticcache.dat": {
     "mincount": 2,
     "maxcount": 2,
     "minbytes": 120,
     "maxbytes": 120
   },
+  "c:\\windows\\prefetch\\{prefetch}.pf": {
+    "ignore": true
+  },
   "c:\\windows\\system32\\audioses.dll": {
     "mincount": 4,
     "maxcount": 4,
     "minbytes": 16384,
     "maxbytes": 32768
   },
   "c:\\windows\\system32\\dwrite.dll": {
     "mincount": 4,
     "maxcount": 4,
     "minbytes": 16384,
     "maxbytes": 90112
   },
+  "c:\\windows\\system32\\gdi32.dll": {
+    "mincount": 0,
+    "maxcount": 4,
+    "minbytes": 0,
+    "maxbytes": 114688
+  },
+  "c:\\windows\\system32\\kernel32.dll": {
+    "mincount": 0,
+    "maxcount": 2,
+    "minbytes": 0,
+    "maxbytes": 65536
+  },
+  "c:\\windows\\system32\\mscms.dll": {
+    "mincount": 0,
+    "maxcount": 73728,
+    "minbytes": 0,
+    "maxbytes": 73728
+  },
   "c:\\windows\\system32\\msctf.dll": {
     "mincount": 0,
     "maxcount": 2,
     "minbytes": 0,
     "maxbytes": 65536
   },
+  "c:\\windows\\system32\\spool\\drivers\\color": {
+    "mincount": 0,
+    "maxcount": 2,
+    "minbytes": 0,
+    "maxbytes": 8192
+  },
   "c:\\windows\\system32\\spool\\drivers\\color\\srgb color space profile.icm": {
     "mincount": 2,
     "maxcount": 2,
     "minbytes": 8192,
     "maxbytes": 8192
   },
+  "z:\\$logfile": {
+    "ignore": true
+  },
   "{appdata}\\local\\temp": {
     "mincount": 0,
     "maxcount": 4,
     "minbytes": 0,
     "maxbytes": 278528
   },
   "{desktop}\\desktop.ini": {
     "mincount": 6,
     "maxcount": 6,
     "minbytes": 1692,
     "maxbytes": 1692
   },
-  "{firefox}\\Crash Reports\\{time}": {
-    "ignore": true
+  "{firefox}\\browser\\blocklist.xml": {
+    "mincount": 0,
+    "maxcount": 66,
+    "minbytes": 0,
+    "maxbytes": 540672
+  },
+  "{firefox}\\browser\\extensions\\{uuid}.xpi": {
+    "mincount": 0,
+    "maxcount": 2,
+    "minbytes": 0,
+    "maxbytes": 8192
+  },
+  "{firefox}\\browser\\features\\aushelper@mozilla.org.xpi": {
+    "mincount": 0,
+    "maxcount": 2,
+    "minbytes": 0,
+    "maxbytes": 24576
+  },
+  "{firefox}\\browser\\features\\flyweb@mozilla.org.xpi": {
+    "mincount": 0,
+    "maxcount": 2,
+    "minbytes": 0,
+    "maxbytes": 32768
   },
   "{firefox}\\browser\\omni.ja": {
     "mincount": 0,
     "maxcount": 28,
     "minbytes": 0,
     "maxbytes": 1835008
   },
+  "{firefox}\\crash reports\\lastcrash": {
+    "mincount": 0,
+    "maxcount": 2,
+    "minbytes": 0,
+    "maxbytes": 20
+  },
+  "{firefox}\\crash reports\\{time}": {
+    "ignore": true
+  },
   "{firefox}\\defaults\\pref\\channel-prefs.js": {
     "mincount": 4,
     "maxcount": 4,
     "minbytes": 1432,
     "maxbytes": 1432
   },
   "{firefox}\\dependentlibs.list": {
     "mincount": 4,
@@ -165,16 +240,22 @@
     "maxbytes": 512
   },
   "{profile}\\content-prefs.sqlite": {
     "mincount": 6,
     "maxcount": 6,
     "minbytes": 65768,
     "maxbytes": 65768
   },
+  "{profile}\\content-prefs.sqlite-journal": {
+    "mincount": 14,
+    "maxcount": 116,
+    "minbytes": 112,
+    "maxbytes": 1244640
+  },
   "{profile}\\cookies.sqlite": {
     "mincount": 1,
     "maxcount": 6,
     "minbytes": 0,
     "maxbytes": 200000
   },
   "{profile}\\cookies.sqlite-shm": {
     "mincount": 1,
@@ -237,16 +318,22 @@
     "maxbytes": 127000
   },
   "{profile}\\extensions\\pageloader@mozilla.org\\chrome\\report.js": {
     "mincount": 0,
     "maxcount": 4,
     "minbytes": 0,
     "maxbytes": 127000
   },
+  "{profile}\\extensions\\pageloader@mozilla.org\\install.rdf": {
+    "mincount": 0,
+    "maxcount": 2,
+    "minbytes": 0,
+    "maxbytes": 8192
+  },
   "{profile}\\extensions\\talos-powers@mozilla.org\\chrome.manifest": {
     "mincount": 2,
     "maxcount": 2,
     "minbytes": 600,
     "maxbytes": 600
   },
   "{profile}\\extensions\\talos-powers@mozilla.org\\chrome\\talos-powers-content.js": {
     "mincount": 2,
@@ -255,16 +342,22 @@
     "maxbytes": 2000
   },
   "{profile}\\favicons.sqlite": {
     "mincount": 8,
     "maxcount": 12,
     "minbytes": 196808,
     "maxbytes": 393216
   },
+  "{profile}\\favicons.sqlite-journal": {
+    "mincount": 2,
+    "maxcount": 8,
+    "minbytes": 16,
+    "maxbytes": 9264
+  },
   "{profile}\\favicons.sqlite-shm": {
     "mincount": 0,
     "maxcount": 4,
     "minbytes": 65536,
     "maxbytes": 131072
   },
   "{profile}\\favicons.sqlite-wal": {
     "mincount": 0,
@@ -273,16 +366,22 @@
     "maxbytes": 131072
   },
   "{profile}\\handlers.json": {
     "mincount": 0,
     "maxcount": 4,
     "minbytes": 0,
     "maxbytes": 1388
   },
+  "{profile}\\invalidprefs.js": {
+    "mincount": 0,
+    "maxcount": 2,
+    "minbytes": 0,
+    "maxbytes": 25412
+  },
   "{profile}\\key3.db": {
     "mincount": 0,
     "maxcount": 12,
     "minbytes": 0,
     "maxbytes": 32768
   },
   "{profile}\\key4.db": {
     "mincount": 0,
@@ -315,16 +414,22 @@
     "maxbytes": 16384
   },
   "{profile}\\places.sqlite": {
     "mincount": 8,
     "maxcount": 8,
     "minbytes": 196808,
     "maxbytes": 196808
   },
+  "{profile}\\places.sqlite-journal": {
+    "mincount": 2,
+    "maxcount": 8,
+    "minbytes": 16,
+    "maxbytes": 9264
+  },
   "{profile}\\places.sqlite-shm": {
     "mincount": 2,
     "maxcount": 2,
     "minbytes": 65536,
     "maxbytes": 65536
   },
   "{profile}\\places.sqlite-wal": {
     "mincount": 0,
@@ -333,16 +438,22 @@
     "maxbytes": 131072
   },
   "{profile}\\pluginreg.dat": {
     "mincount": 2,
     "maxcount": 2,
     "minbytes": 1892,
     "maxbytes": 1892
   },
+  "{profile}\\pluginreg.dat.tmp": {
+    "mincount": 0,
+    "maxcount": 30,
+    "minbytes": 0,
+    "maxbytes": 958
+  },
   "{profile}\\prefs-1.js": {
     "mincount": 0,
     "maxcount": 10,
     "minbytes": 0,
     "maxbytes": 53950
   },
   "{profile}\\prefs.js": {
     "mincount": 4,
@@ -399,21 +510,15 @@
     "maxbytes": 6000
   },
   "{profile}\\xulstore.json": {
     "mincount": 0,
     "maxcount": 0,
     "minbytes": 0,
     "maxbytes": 702
   },
-  "{talos}\\talos\\tests\\tp5n\\tp5n.manifest": {
+  "{talos}\\talos\\tests\\{tp5n_files}": {
     "mincount": 0,
-    "maxcount": 8,
+    "maxcount": 2,
     "minbytes": 0,
-    "maxbytes": 32786
-  },
-  "{talos}\\talos\\tests\\tp5n\\tp5n.manifest.develop": {
-    "mincount": 0,
-    "maxcount": 8,
-    "minbytes": 0,
-    "maxbytes": 32786
+    "maxbytes": 16384
   }
-}
+}
\ No newline at end of file