Bug 1512627 - Fix intermittent issue in browser_searchTelemetry by ensuring we wait for all scalars before continuing. r=mak, a=test-only
authorMark Banner <standard8@mozilla.com>
Wed, 19 Dec 2018 15:45:25 +0000
changeset 509108 f5f8fa9859614c5a4bf1f6b3eb2d19e26889fa23
parent 509107 514d347e259eca8b0ae810565fa517ad7f25b91f
child 509109 7fce298d99a171adb79d268edf88f9dd4fda8dca
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak, test-only
bugs1512627
milestone65.0
Bug 1512627 - Fix intermittent issue in browser_searchTelemetry by ensuring we wait for all scalars before continuing. r=mak, a=test-only Differential Revision: https://phabricator.services.mozilla.com/D14894
browser/components/search/test/browser/browser_searchTelemetry.js
--- a/browser/components/search/test/browser/browser_searchTelemetry.js
+++ b/browser/components/search/test/browser/browser_searchTelemetry.js
@@ -50,18 +50,17 @@ async function assertTelemetry(expectedH
     return Object.getOwnPropertyNames(histSnapshot).length ==
       Object.getOwnPropertyNames(expectedHistograms).length;
   }, "should have the correct number of histograms");
 
   if (Object.entries(expectedScalars).length > 0) {
     await TestUtils.waitForCondition(() => {
       scalars = Services.telemetry.getSnapshotForKeyedScalars(
         "main", false).parent || {};
-      return Object.getOwnPropertyNames(expectedScalars)[0] in
-        scalars;
+      return Object.getOwnPropertyNames(expectedScalars).every(scalar => scalar in scalars);
     }, "should have the expected keyed scalars");
   }
 
   Assert.equal(Object.getOwnPropertyNames(histSnapshot).length,
     Object.getOwnPropertyNames(expectedHistograms).length,
     "Should only have one key");
 
   for (let [key, value] of Object.entries(expectedHistograms)) {