Bug 1261816 - Guard against the mochitest harness finish()ing a test that already finished. r=jmaher a=test-only
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 04 Apr 2016 13:46:12 -0400
changeset 323783 6ebd54f5ed82ae5d85d45328939c783c27b5b77b
parent 323782 7e501ac324813f5a64da98ec24bbe9eb14eab673
child 323784 4467b50b189b6f07dfdd2c48992749cf56487e15
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher, test-only
bugs1261816
milestone47.0a2
Bug 1261816 - Guard against the mochitest harness finish()ing a test that already finished. r=jmaher a=test-only MozReview-Commit-ID: 3w5xfSgJteG
testing/mochitest/tests/SimpleTest/SimpleTest.js
--- a/testing/mochitest/tests/SimpleTest/SimpleTest.js
+++ b/testing/mochitest/tests/SimpleTest/SimpleTest.js
@@ -1557,13 +1557,13 @@ window.onerror = function simpletestOner
             SimpleTest.info("Exception thrown by gOldOnError(): " + e);
             // Log its stack.
             if (e.stack) {
                 SimpleTest.info("JavaScript error stack:\n" + e.stack);
             }
         }
     }
 
-    if (!SimpleTest._stopOnLoad && !isExpected) {
+    if (!SimpleTest._stopOnLoad && !isExpected && !SimpleTest._alreadyFinished) {
         // Need to finish() manually here, yet let the test actually end first.
         SimpleTest.executeSoon(SimpleTest.finish);
     }
 };