Bug 962871 - Don't run GC/CC in-between tests for it is very slow and causes timeout on B2G debug. r=cpearce
☠☠ backed out by 7704043c4fe5 ☠ ☠
authorJW Wang <jwwang@mozilla.com>
Sun, 14 Sep 2014 23:29:00 +0200
changeset 205589 8b181c601afb34cfddf31297da5425aa76d4caf9
parent 205588 8cada343f1ab41643d9107644401a5747335e745
child 205590 83d364b2f226832d0e1e9eb6c1382d48ef266654
push id27498
push userkwierso@gmail.com
push dateWed, 17 Sep 2014 00:06:56 +0000
treeherdermozilla-central@8252eae8278c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs962871
milestone35.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 962871 - Don't run GC/CC in-between tests for it is very slow and causes timeout on B2G debug. r=cpearce
content/media/test/manifest.js
--- a/content/media/test/manifest.js
+++ b/content/media/test/manifest.js
@@ -663,19 +663,21 @@ function getPlayableAudio(candidates) {
 function getMajorMimeType(mimetype) {
   if (/^video/.test(mimetype)) {
     return "video";
   } else {
     return "audio";
   }
 }
 
+// Force releasing decoder to avoid timeout in waiting for decoding resource.
 function removeNodeAndSource(n) {
   n.remove();
-  // force release of underlying decoder
+  // reset |mozSrcObject| first since it takes precedence over |src|.
+  n.mozSrcObject = null;
   n.src = "";
   while (n.firstChild) {
     n.removeChild(n.firstChild);
   }
 }
 
 // Number of tests to run in parallel. Warning: Each media element requires
 // at least 3 threads (4 on Linux), and on Linux each thread uses 10MB of
@@ -764,54 +766,49 @@ function MediaTestManager() {
       this.nextTest();
       this.watchdog = setTimeout(this.watchdogFn.bind(this), 10000);
     }
   }
 
   // Starts the next batch of tests, or finishes if they're all done.
   // Don't call this directly, call finished(token) when you're done.
   this.nextTest = function() {
-    // Force an exact  GC after every completed testcase. This ensures that any
-    // decoders with live threads waiting for the GC are killed promptly, to free
-    // up the thread stacks' address space, and destroy decoder resources.
-    SpecialPowers.exactGC(window, function(){
-      while (this.testNum < this.tests.length && this.tokens.length < PARALLEL_TESTS) {
-        var test = this.tests[this.testNum];
-        var token = (test.name ? (test.name + "-"): "") + this.testNum;
-        this.testNum++;
+    while (this.testNum < this.tests.length && this.tokens.length < PARALLEL_TESTS) {
+      var test = this.tests[this.testNum];
+      var token = (test.name ? (test.name + "-"): "") + this.testNum;
+      this.testNum++;
 
-        if (DEBUG_TEST_LOOP_FOREVER && this.testNum == this.tests.length) {
-          this.testNum = 0;
-        }
-
-        // Ensure we can play the resource type.
-        if (test.type && !document.createElement('video').canPlayType(test.type))
-          continue;
-
-        // Do the init. This should start the test.
-        this.startTest(test, token);
+      if (DEBUG_TEST_LOOP_FOREVER && this.testNum == this.tests.length) {
+        this.testNum = 0;
       }
 
-      if (this.testNum == this.tests.length &&
-          !DEBUG_TEST_LOOP_FOREVER &&
-          this.tokens.length == 0 &&
-          !this.isShutdown)
-      {
-        this.isShutdown = true;
-        if (this.onFinished) {
-          this.onFinished();
-        }
-        mediaTestCleanup();
-        var end = new Date();
-        SimpleTest.info("Finished at " + end + " (" + (end.getTime() / 1000) + "s)");
-        SimpleTest.info("Running time: " + (end.getTime() - this.startTime.getTime())/1000 + "s");
-        SimpleTest.finish();
-        return;
+      // Ensure we can play the resource type.
+      if (test.type && !document.createElement('video').canPlayType(test.type))
+        continue;
+
+      // Do the init. This should start the test.
+      this.startTest(test, token);
+    }
+
+    if (this.testNum == this.tests.length &&
+        !DEBUG_TEST_LOOP_FOREVER &&
+        this.tokens.length == 0 &&
+        !this.isShutdown)
+    {
+      this.isShutdown = true;
+      if (this.onFinished) {
+        this.onFinished();
       }
-    }.bind(this));
+      mediaTestCleanup();
+      var end = new Date();
+      SimpleTest.info("Finished at " + end + " (" + (end.getTime() / 1000) + "s)");
+      SimpleTest.info("Running time: " + (end.getTime() - this.startTime.getTime())/1000 + "s");
+      SimpleTest.finish();
+      return;
+    }
   }
 }
 
 // Ensures we've got no active video or audio elements in the document, and
 // forces a GC to release the address space reserved by the decoders' threads'
 // stacks.
 function mediaTestCleanup() {
     var V = document.getElementsByTagName("video");