Bug 1551347 - Fix Uptake Telemetry test failure if channel is release. r=glasserc, a=test-only
authorMathieu Leplatre <mathieu@mozilla.com>
Tue, 14 May 2019 09:24:01 -0400
changeset 526549 8d1cd279ea4c160af30904f8ba7b65c3ef806f8f
parent 526548 0dd2fe24bc08b569f02f32337a2d118704c0f8b3
child 526550 a86de23411340179dde3baa084d29606d6f91030
push id2039
push userryanvm@gmail.com
push dateTue, 14 May 2019 15:29:12 +0000
treeherdermozilla-release@8d1cd279ea4c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglasserc, test-only
bugs1551347
milestone67.0
Bug 1551347 - Fix Uptake Telemetry test failure if channel is release. r=glasserc, a=test-only Differential Revision: https://phabricator.services.mozilla.com/D31005
services/common/tests/unit/test_uptake_telemetry.js
services/common/tests/unit/xpcshell.ini
--- 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);
--- a/services/common/tests/unit/xpcshell.ini
+++ b/services/common/tests/unit/xpcshell.ini
@@ -55,9 +55,8 @@ skip-if = os == "android"
 
 [test_tokenauthenticatedrequest.js]
 skip-if = os == "android"
 
 [test_tokenserverclient.js]
 skip-if = os == "android"
 
 [test_uptake_telemetry.js]
-skip-if = !debug # Bug 1551347