Bug 1602757: Telemetry checks overrideUpdateChannel only at process startup r=chutten
☠☠ backed out by f519fea12dfc ☠ ☠
authorRandell Jesup <rjesup@wgate.com>
Thu, 28 May 2020 21:37:26 +0000
changeset 596597 4b9c579de3b2be5477a24021a97d38c7e3f5a59f
parent 596596 a34288a6f60c6e99af1b9c28bdb474291372381b
child 596598 58ec60831af6c649a19ae2889ff02f0724c79aa7
push id13186
push userffxbld-merge
push dateMon, 01 Jun 2020 09:52:46 +0000
treeherdermozilla-beta@3e7c70a1e4a1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschutten
bugs1602757
milestone78.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 1602757: Telemetry checks overrideUpdateChannel only at process startup r=chutten Since this is checked only at startup, to ensure it propagates to all content processes we have to ensure we shut down and restart all preallocated or cached processes (though the process running the current page won't restart) Differential Revision: https://phabricator.services.mozilla.com/D76188
toolkit/components/telemetry/tests/browser/browser_DynamicScalars.js
--- a/toolkit/components/telemetry/tests/browser/browser_DynamicScalars.js
+++ b/toolkit/components/telemetry/tests/browser/browser_DynamicScalars.js
@@ -25,19 +25,29 @@ async function waitForProcessesScalars(
       aProcesses.every(p => Object.keys(scalars).includes(p)) &&
       aAdditionalCondition(scalars)
     );
   });
 }
 
 add_task(async function test_setup() {
   // Make sure the newly spawned content processes will have extended Telemetry enabled.
+  // Since Telemetry reads the prefs only at process startup, flush all cached
+  // and preallocated processes so they pick up the setting.
   await SpecialPowers.pushPrefEnv({
-    set: [[TelemetryUtils.Preferences.OverridePreRelease, true]],
+    set: [
+      [TelemetryUtils.Preferences.OverridePreRelease, true],
+      ["dom.ipc.processPrelaunch.enabled", false],
+    ],
   });
+  Services.ppmm.releaseCachedProcesses();
+  await SpecialPowers.pushPrefEnv({
+    set: [["dom.ipc.processPrelaunch.enabled", true]],
+  });
+
   // And take care of the already initialized one as well.
   let canRecordExtended = Services.telemetry.canRecordExtended;
   Services.telemetry.canRecordExtended = true;
   registerCleanupFunction(
     () => (Services.telemetry.canRecordExtended = canRecordExtended)
   );
 });
 
@@ -116,19 +126,19 @@ add_task(async function test_recording()
           "testKey",
           3
         );
       });
     }
   );
 
   // Wait for the dynamic scalars to appear non-keyed snapshots.
-  await waitForProcessesScalars(["dynamic"], false, scalars => {
+  await waitForProcessesScalars(["dynamic"], true, scalars => {
     // Wait for the scalars set in the content process to be available.
-    return "telemetry.test.dynamic.pre_content_spawn" in scalars.dynamic;
+    return "telemetry.test.dynamic.post_content_spawn_keyed" in scalars.dynamic;
   });
 
   // Verify the content of the snapshots.
   const scalars = Services.telemetry.getSnapshotForScalars("main", false);
   ok(
     "dynamic" in scalars,
     "The scalars must contain the 'dynamic' process section"
   );