Bug 1409739 - Part 1: Accept SmokeDMD when filtering test DMD stacks. r=njn
authorEric Rahm <erahm@mozilla.com>
Mon, 01 Oct 2018 16:38:17 -0700
changeset 488401 46462bfc0e9b3de81847600e6d15f2c688766cde
parent 488400 7b660cc5c5b4dbc502327a6e88a6823deec976f8
child 488402 74abe131db1b909552db62ba35aef83f5d1dc802
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewersnjn
bugs1409739
milestone64.0a1
Bug 1409739 - Part 1: Accept SmokeDMD when filtering test DMD stacks. r=njn On some builds we only get 'SmokeDMD' references during testing rather than a full file path. This adds 'SmokeDMD' to the acceptable frame description list.
memory/replace/dmd/dmd.py
memory/replace/dmd/test/xpcshell.ini
--- a/memory/replace/dmd/dmd.py
+++ b/memory/replace/dmd/dmd.py
@@ -327,25 +327,27 @@ def getDigestFromFile(args, inputFile):
 
     def buildTraceDescription(traceTable, frameTable, traceKey):
         frameKeys = traceTable[traceKey]
         fmt = '    #{:02d}{:}'
 
         if args.filter_stacks_for_testing:
             # When running SmokeDMD.cpp, every stack trace should contain at
             # least one frame that contains 'DMD.cpp', from either |DMD.cpp| or
-            # |SmokeDMD.cpp|. (Or 'dmd.cpp' on Windows.) If we see such a
+            # |SmokeDMD.cpp|. (Or 'dmd.cpp' on Windows.) On builds without
+            # debuginfo we expect just |SmokeDMD|. If we see such a
             # frame, we replace the entire stack trace with a single,
             # predictable frame. There is too much variation in the stack
             # traces across different machines and platforms to do more precise
             # matching, but this level of matching will result in failure if
             # stack fixing fails completely.
             for frameKey in frameKeys:
                 frameDesc = frameTable[frameKey]
-                if 'DMD.cpp' in frameDesc or 'dmd.cpp' in frameDesc:
+                expected = ('DMD.cpp', 'dmd.cpp', 'SmokeDMD')
+                if any(ex in frameDesc for ex in expected):
                     return [fmt.format(1, ': ... DMD.cpp ...')]
 
         # The frame number is always '#00' (see DMD.h for why), so we have to
         # replace that with the correct frame number.
         desc = []
         for n, frameKey in enumerate(traceTable[traceKey], start=1):
             desc.append(fmt.format(n, frameTable[frameKey][3:]))
         return desc
--- a/memory/replace/dmd/test/xpcshell.ini
+++ b/memory/replace/dmd/test/xpcshell.ini
@@ -26,9 +26,9 @@ support-files =
   script-diff-live2.json
   script-diff-live-expected.txt
   script-diff-dark-matter1.json
   script-diff-dark-matter2.json
   script-diff-dark-matter-expected.txt
 
 [test_dmd.js]
 dmd = true
-skip-if = !(os=='linux' || os=='win' || os=='mac')
+skip-if = !(os=='linux' || os=='mac' || (os=='win' && !pgo))