Bug 1471724: Part 1 - Use the correct structured logging for Shutdown task. r?jmaher draft
authorKris Maglione <maglione.k@gmail.com>
Wed, 27 Jun 2018 14:08:53 -0700
changeset 811600 c92f944b437915a933ac8003752c60e902d7fdb6
parent 811599 841ed9c78bf765e7d9f40614c29853948b6680d0
child 811601 322b7e526ee43ac201420e2dc2ed2a8a15809a18
child 811653 8b709193215e71d508a02566ea3c2d8822f6e627
push id114367
push usermaglione.k@gmail.com
push dateWed, 27 Jun 2018 22:22:54 +0000
reviewersjmaher
bugs1471724
milestone63.0a1
Bug 1471724: Part 1 - Use the correct structured logging for Shutdown task. r?jmaher The mochitest harnesses currently log the shutdown task as a non-structured info messages, which leads to shutdown hangs being arbitrarily mis-attributed to whichever test ran last. Structured logging it as a test_start action gives us the correct failure info in the outer harness. MozReview-Commit-ID: 1ibVqZdJZHF
testing/mochitest/browser-test.js
testing/mochitest/tests/SimpleTest/TestRunner.js
--- a/testing/mochitest/browser-test.js
+++ b/testing/mochitest/browser-test.js
@@ -626,17 +626,17 @@ Tester.prototype = {
 
     // It's important to terminate the module to avoid crashes on shutdown.
     this.PromiseTestUtils.uninit();
 
     // In the main process, we print the ShutdownLeaksCollector message here.
     let pid = Services.appinfo.processID;
     dump("Completed ShutdownLeaks collections in process " + pid + "\n");
 
-    this.structuredLogger.info("TEST-START | Shutdown");
+    this.structuredLogger.testStart("Shutdown");
 
     if (this.tests.length) {
       let e10sMode = gMultiProcessBrowser ? "e10s" : "non-e10s";
       this.structuredLogger.info("Browser Chrome Test Summary");
       this.structuredLogger.info("Passed:  " + passCount);
       this.structuredLogger.info("Failed:  " + failCount);
       this.structuredLogger.info("Todo:    " + todoCount);
       this.structuredLogger.info("Mode:    " + e10sMode);
--- a/testing/mochitest/tests/SimpleTest/TestRunner.js
+++ b/testing/mochitest/tests/SimpleTest/TestRunner.js
@@ -455,17 +455,17 @@ TestRunner.runNextTest = function() {
             // ... the indicator.
             var indicator = $("indicator");
             indicator.innerHTML = "Status: Fail (No checks actually run)";
             indicator.style.backgroundColor = "red";
         }
 
         let e10sMode = SpecialPowers.isMainProcess() ? "non-e10s" : "e10s";
 
-        TestRunner.structuredLogger.info("TEST-START | Shutdown");
+        TestRunner.structuredLogger.testStart("Shutdown");
         TestRunner.structuredLogger.info("Passed:  " + passCount);
         TestRunner.structuredLogger.info("Failed:  " + failCount);
         TestRunner.structuredLogger.info("Todo:    " + todoCount);
         TestRunner.structuredLogger.info("Mode:    " + e10sMode);
         TestRunner.structuredLogger.info("Slowest: " + TestRunner.slowestTestTime + 'ms - ' + TestRunner.slowestTestURL);
 
         // If we are looping, don't send this cause it closes the log file,
         // also don't unregister the crash observers until we're done.