Bug 1446833: Part 3 - Match more common head.js filename patterns when filtering assertion stack frames. r=florian
authorKris Maglione <maglione.k@gmail.com>
Sun, 18 Mar 2018 15:32:47 -0700
changeset 409130 1f99f10985f541a9e192ffe3c59b06ef91dce1f1
parent 409129 e2a78fa784c69656b837b9034d008046576fa60f
child 409131 fd8f5976ecbb4b9ed119540bd95bed5824848074
push id33676
push usertoros@mozilla.com
push dateWed, 21 Mar 2018 10:03:44 +0000
treeherdermozilla-central@e636edf00e6f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs1446833
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1446833: Part 3 - Match more common head.js filename patterns when filtering assertion stack frames. r=florian The xpcshell harness tries to filter out head.js stack frames when reporting errors. When it fails, it tends to report strange error locations, with the name of a unit test file, but the line number of a line in a head file. This changes the filter to match more common head.js files, such as head_addons.js. MozReview-Commit-ID: FASWNSR0Noc
testing/xpcshell/head.js
--- a/testing/xpcshell/head.js
+++ b/testing/xpcshell/head.js
@@ -779,17 +779,19 @@ function do_note_exception(ex, text) {
   _testLogger.info(text + "Swallowed exception " + _exception_message(ex),
                    {
                      source_file: filename,
                      stack: _format_stack(ex.stack)
                    });
 }
 
 function do_report_result(passed, text, stack, todo) {
-  while (stack.filename.includes("head.js") && stack.caller) {
+  // Match names like head.js, head_foo.js, and foo_head.js, but not
+  // test_headache.js
+  while (/(\/head(_.+)?|head)\.js$/.test(stack.filename) && stack.caller) {
     stack = stack.caller;
   }
 
   let name = _gRunningTest ? _gRunningTest.name : stack.name;
   let message;
   if (name) {
      message = "[" + name + " : " + stack.lineNumber + "] " + text;
   } else {