Bug 1481485 - Fix Android-only failure related to telemetry tests when running on Beta. r=Dexter
authorLuca Greco <lgreco@mozilla.com>
Thu, 09 Aug 2018 12:44:37 +0000
changeset 486072 dcab8343b3db152c68e2e981cd22b0cb77ebaf5c
parent 486071 5a51b1f6d4f9e32d728912b9352a66120a8a10a5
child 486073 003ea7d3924f1c439c859d178e64e24a8fffeab0
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersDexter
bugs1481485, 1380287
milestone63.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 1481485 - Fix Android-only failure related to telemetry tests when running on Beta. r=Dexter This patch contains a small fix needed to fix an Android-only failure related to the test test_ext_storage_idb_data_migration.js when running on a non-Nightly build. After digging into it a bit I notice that the reason behind this failure is similar to the one we fixed an year ago in Bug 1380287 for another test telemetry-related. Differential Revision: https://phabricator.services.mozilla.com/D2952
toolkit/components/extensions/test/xpcshell/test_ext_storage_idb_data_migration.js
--- a/toolkit/components/extensions/test/xpcshell/test_ext_storage_idb_data_migration.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_storage_idb_data_migration.js
@@ -82,16 +82,25 @@ add_task(async function setup() {
   Services.prefs.setBoolPref(ExtensionStorageIDB.BACKEND_ENABLED_PREF, true);
   setLowDiskMode(false);
 
   await promiseStartupManager();
 
   // Telemetry test setup needed to ensure that the builtin events are defined
   // and they can be collected and verified.
   await TelemetryController.testSetup();
+
+  // This is actually only needed on Android, because it does not properly support unified telemetry
+  // and so, if not enabled explicitly here, it would make these tests to fail when running on a
+  // non-Nightly build.
+  const oldCanRecordBase = Services.telemetry.canRecordBase;
+  Services.telemetry.canRecordBase = true;
+  registerCleanupFunction(() => {
+    Services.telemetry.canRecordBase = oldCanRecordBase;
+  });
 });
 
 // Test that the old data is migrated successfully to the new storage backend
 // and that the original JSONFile has been renamed.
 add_task(async function test_storage_local_data_migration() {
   const EXTENSION_ID = "extension-to-be-migrated@mozilla.org";
 
   // Keep the extension storage and the uuid on uninstall, to verify that no telemetry events