Bug 1115779 - Fix devtools web audio intermittent timeouts by waiting for a tick before collecting nodes. r=jryans, a=test-only
authorAlexandre Poirot <poirot.alex@gmail.com>
Thu, 19 May 2016 15:44:00 -0400
changeset 333420 0f655045e4354b6b88eadf93e61a928b7d1610f2
parent 333419 e07acf9e5bd8085c77a4bf6131d2894c53a7e542
child 333421 9e34fce9b92180799a0d2ece7b5d282bdda1af58
push id6100
push userryanvm@gmail.com
push dateThu, 23 Jun 2016 19:27:56 +0000
treeherdermozilla-beta@13b02b96281e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans, test-only
bugs1115779
milestone48.0
Bug 1115779 - Fix devtools web audio intermittent timeouts by waiting for a tick before collecting nodes. r=jryans, a=test-only
devtools/client/webaudioeditor/test/browser_wa_destroy-node-01.js
devtools/client/webaudioeditor/test/browser_webaudio-actor-destroy-node.js
--- a/devtools/client/webaudioeditor/test/browser_wa_destroy-node-01.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_destroy-node-01.js
@@ -33,16 +33,19 @@ add_task(function*() {
 
   // Flatten arrays of event arguments and take the first (AudioNodeModel)
   // and get its ID.
   let actorIDs = created.map(ev => ev[0].id);
 
   // Click a soon-to-be dead buffer node
   yield clickGraphNode(panelWin, actorIDs[5]);
 
+  // Wait for a tick before gc to prevent this test from intermittent timeout
+  // where the node never get collected.
+  yield DevToolsUtils.waitForTick();
   forceCC();
 
   // Wait for destruction and graph to re-render
   yield Promise.all([destroyed, waitForGraphRendered(panelWin, 3, 2)]);
 
   // Test internal storage
   is(panelWin.gAudioNodes.length, 3, "All nodes should be GC'd except one gain, osc and dest node.");
 
--- a/devtools/client/webaudioeditor/test/browser_webaudio-actor-destroy-node.js
+++ b/devtools/client/webaudioeditor/test/browser_webaudio-actor-destroy-node.js
@@ -11,16 +11,20 @@ add_task(function*() {
   let waitUntilDestroyed = getN(front, "destroy-node", 10);
   let [, , created] = yield Promise.all([
     front.setup({ reload: true }),
     once(front, "start-context"),
     // Should create 1 destination node and 10 disposable buffer nodes
     getN(front, "create-node", 13)
   ]);
 
+  // Wait for a tick before gc to prevent this test from intermittent timeout
+  // where the node never get collected.
+  yield DevToolsUtils.waitForTick();
+
   // Force CC so we can ensure it's run to clear out dead AudioNodes
   forceCC();
 
   let destroyed = yield waitUntilDestroyed;
 
   destroyed.forEach((node, i) => {
     ok(node.type, "AudioBufferSourceNode", "Only buffer nodes are destroyed");
     ok(actorIsInList(created, destroyed[i]),