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
--- 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.