Bug 1319247 - Fix devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_batching.js intermittent; r=bgrins
authorNicolas Chevobbe <chevobbe.nicolas@gmail.com>
Thu, 24 Nov 2016 20:19:44 +0100
changeset 324685 5e3fb7348212c811644fb8449304214e8d63587c
parent 324684 dcdee53249e1afe2cc62b50dcdfe5a1f5f2dcd3d
child 324686 52a5ff34b3b36e789ed21c2665889b8833ec61b0
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersbgrins
bugs1319247
milestone53.0a1
Bug 1319247 - Fix devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_batching.js intermittent; r=bgrins Adjust `waitFor` default interval and retries in head.js to speed things up for the better case. In the test, remove the logging when the state changes saves a lot of time. MozReview-Commit-ID: LWdClmzzJ3P
devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_batching.js
devtools/client/webconsole/new-console-output/test/mochitest/head.js
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_batching.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_batching.js
@@ -7,34 +7,16 @@
 
 // Check adding console calls as batch keep the order of the message.
 
 const TEST_URI = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/mochitest/test-batching.html";
 const { l10n } = require("devtools/client/webconsole/new-console-output/utils/messages");
 
 add_task(function* () {
   let hud = yield openNewTabAndConsole(TEST_URI);
-
-  const store = hud.ui.newConsoleOutput.getStore();
-  // Adding loggin each time the store is modified in order to check
-  // the store state in case of failure.
-  store.subscribe(() => {
-    const messages = store.getState().messages.messagesById.toJS()
-      .map(message => {
-        return {
-          id: message.id,
-          type: message.type,
-          parameters: message.parameters,
-          messageText: message.messageText
-        };
-      }
-    );
-    info("messages : " + JSON.stringify(messages));
-  });
-
   const messageNumber = 100;
   yield testSimpleBatchLogging(hud, messageNumber);
   yield testBatchLoggingAndClear(hud, messageNumber);
 });
 
 function* testSimpleBatchLogging(hud, messageNumber) {
   yield ContentTask.spawn(gBrowser.selectedBrowser, messageNumber,
     function (numMessages) {
--- a/devtools/client/webconsole/new-console-output/test/mochitest/head.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/head.js
@@ -90,17 +90,17 @@ function waitForMessages({ hud, messages
  *        true in order to return the value.
  * @param string message [optional]
  *        A message to output if the condition failes.
  * @param number interval [optional]
  *        How often the predicate is invoked, in milliseconds.
  * @return object
  *         A promise that is resolved with the result of the condition.
  */
-function* waitFor(condition, message = "waitFor", interval = 100, maxTries = 50) {
+function* waitFor(condition, message = "waitFor", interval = 10, maxTries = 500) {
   return new Promise(resolve => {
     BrowserTestUtils.waitForCondition(condition, message, interval, maxTries)
       .then(() => resolve(condition()));
   });
 }
 
 /**
  * Find a message in the output.