Bug 1470280 - Part 1: Make browser_preferences_usage.js less brittle. r=kmag
☠☠ backed out by 2d2dee08739f ☠ ☠
authorEric Rahm <erahm@mozilla.com>
Fri, 05 Oct 2018 14:28:58 -0700
changeset 496103 60699c2387f6e51398c345996a97551a867bd2d7
parent 496102 c19f84cb5fcbf896171350432d4476ba27d11d15
child 496104 fe7ccd9fee7621782676d9bd841c144126e24c04
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1470280
milestone64.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 1470280 - Part 1: Make browser_preferences_usage.js less brittle. r=kmag browser_preferences_usage.js hardcodes a max value of 15 accesses which doesn't scale well as we increase the number of processes. Instead we'll base the max on a multiplier of the default process count which should avoid bustage in the future but still catch egregious accesses.
browser/base/content/test/performance/browser_preferences_usage.js
--- a/browser/base/content/test/performance/browser_preferences_usage.js
+++ b/browser/base/content/test/performance/browser_preferences_usage.js
@@ -1,11 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+const DEFAULT_PROCESS_COUNT = Services.prefs.getDefaultBranch(null).getIntPref("dom.ipc.processCount");
+
 /**
  * A test that checks whether any preference getter from the given list
  * of stats was called more often than the max parameter.
  *
  * @param {Array}  stats - an array of [prefName, accessCount] tuples
  * @param {Number} max - the maximum number of times any of the prefs should
  *                 have been called.
  * @param {Object} whitelist (optional) - an object that defines
@@ -115,17 +117,20 @@ add_task(async function startup() {
 
   ok(startupRecorder.data.prefStats, "startupRecorder has prefStats");
 
   checkPrefGetters(startupRecorder.data.prefStats, max, whitelist);
 });
 
 // This opens 10 tabs and checks pref getters.
 add_task(async function open_10_tabs() {
-  let max = 15;
+  // This is somewhat arbitrary. When we had a default of 4 content processes
+  // the value was 15. We need to scale it as we increase the number of
+  // content processes so we approximate with 4 * process_count.
+  const max = 4 * DEFAULT_PROCESS_COUNT;
 
   let whitelist = {
     "layout.css.dpi": {
       max: 35,
     },
     "browser.zoom.full": {
       min: 10,
       max: 25,
@@ -141,20 +146,16 @@ add_task(async function open_10_tabs() {
     "security.insecure_connection_text.enabled": {
       min: 10,
       max: 18,
     },
     "security.insecure_connection_text.pbmode.enabled": {
       min: 10,
       max: 18,
     },
-    "dom.ipc.processCount": {
-      min: 10,
-      max: 15,
-    },
     "browser.startup.record": {
       max: 20,
     },
     "browser.tabs.remote.logSwitchTiming": {
       max: 25,
     },
     "network.loadinfo.skip_type_assertion": {
       // This is accessed in debug only.