Bug 1551347 - Fix Uptake Telemetry test failure if channel is release r=glasserc
authorMathieu Leplatre <mathieu@mozilla.com>
Tue, 14 May 2019 13:13:23 +0000
changeset 532597 1d7e8c0d4f718d3ea1b665b9133e7ef90f932e27
parent 532596 37081b3411f5ed9475b2b72e6ce6433a42125d67
child 532598 78915e9ee8f8fea4a779a171014ec35eb8d36186
push id11270
push userrgurzau@mozilla.com
push dateWed, 15 May 2019 15:07:19 +0000
treeherdermozilla-beta@571bc76da583 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglasserc
bugs1551347
milestone68.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 1551347 - Fix Uptake Telemetry test failure if channel is release r=glasserc Differential Revision: https://phabricator.services.mozilla.com/D31005
services/common/tests/unit/test_uptake_telemetry.js
--- a/services/common/tests/unit/test_uptake_telemetry.js
+++ b/services/common/tests/unit/test_uptake_telemetry.js
@@ -44,17 +44,19 @@ add_task(async function test_unknown_sta
   const expectedIncrements = {};
   checkUptakeTelemetry(startHistogram, endHistogram, expectedIncrements);
 });
 
 add_task(async function test_age_is_converted_to_string_and_reported() {
   const status = UptakeTelemetry.STATUS.SUCCESS;
   const age = 42;
 
-  await UptakeTelemetry.report(COMPONENT, status, { source: "s", age });
+  await withFakeChannel("nightly", async () => { // no sampling.
+    await UptakeTelemetry.report(COMPONENT, status, { source: "s", age });
+  });
 
   TelemetryTestUtils.assertEvents(
     [["uptake.remotecontent.result", "uptake", COMPONENT, status, { source: "s", age: `${age}` }]]);
 });
 
 add_task(async function test_each_status_can_be_caught_in_snapshot() {
   const source = "some-source";
   const startHistogram = getUptakeTelemetrySnapshot(source);