Bug 1731630 - [devtools] Record leaks when reloading the page for all panels. r=jdescottes
authorAlexandre Poirot <poirot.alex@gmail.com>
Thu, 23 Sep 2021 07:35:24 +0000
changeset 593015 2de970df61facf4ca0630525a3743386e648639d
parent 593014 e85ff66e3ebda143d8a281a2f424e0f11ede2359
child 593016 5907bdad7aee3d783e5c2014fa59ea88051277fb
push id38820
push usersmolnar@mozilla.com
push dateThu, 23 Sep 2021 21:45:25 +0000
treeherdermozilla-central@4eda9eb8926b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1731630
milestone94.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 1731630 - [devtools] Record leaks when reloading the page for all panels. r=jdescottes We should probably tweak the test page to include logs and sources... Differential Revision: https://phabricator.services.mozilla.com/D126112
devtools/client/framework/moz.build
devtools/client/framework/test/allocations/browser_allocations_reload.ini
devtools/client/framework/test/allocations/browser_allocations_reload.js
devtools/client/framework/test/allocations/browser_allocations_reload_debugger.ini
devtools/client/framework/test/allocations/browser_allocations_reload_debugger.js
devtools/client/framework/test/allocations/browser_allocations_reload_inspector.ini
devtools/client/framework/test/allocations/browser_allocations_reload_inspector.js
devtools/client/framework/test/allocations/browser_allocations_reload_netmonitor.ini
devtools/client/framework/test/allocations/browser_allocations_reload_netmonitor.js
devtools/client/framework/test/allocations/browser_allocations_reload_webconsole.ini
devtools/client/framework/test/allocations/browser_allocations_reload_webconsole.js
devtools/client/framework/test/allocations/moz.build
--- a/devtools/client/framework/moz.build
+++ b/devtools/client/framework/moz.build
@@ -1,19 +1,15 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 BROWSER_CHROME_MANIFESTS += [
-    "test/allocations/browser_allocations_browser_console.ini",
-    "test/allocations/browser_allocations_reload.ini",
-    "test/allocations/browser_allocations_target.ini",
-    "test/allocations/browser_allocations_toolbox.ini",
     "test/browser-enable-popup-devtools-user.ini",
     "test/browser-enable-popup-new-user.ini",
     "test/browser-telemetry-startup.ini",
     "test/browser.ini",
     "test/metrics/browser_metrics.ini",
     "test/metrics/browser_metrics_debugger.ini",
     "test/metrics/browser_metrics_inspector.ini",
     "test/metrics/browser_metrics_netmonitor.ini",
@@ -21,16 +17,17 @@ BROWSER_CHROME_MANIFESTS += [
 ]
 XPCSHELL_TESTS_MANIFESTS += ["test/xpcshell/xpcshell.ini"]
 
 DIRS += [
     "actions",
     "browser-toolbox",
     "components",
     "reducers",
+    "test/allocations",
 ]
 
 DevToolsModules(
     "browser-menus.js",
     "descriptor-from-url.js",
     "devtools-browser.js",
     "devtools.js",
     "enable-devtools-popup.js",
rename from devtools/client/framework/test/allocations/browser_allocations_reload.ini
rename to devtools/client/framework/test/allocations/browser_allocations_reload_debugger.ini
--- a/devtools/client/framework/test/allocations/browser_allocations_reload.ini
+++ b/devtools/client/framework/test/allocations/browser_allocations_reload_debugger.ini
@@ -4,10 +4,10 @@ subsuite = devtools
 support-files =
   !/devtools/shared/test-helpers/allocation-tracker.js
   head.js
   reloaded-page.html
   reloaded.png
 
 # Each metrics tests is loaded in a separate .ini file. This way the test is executed
 # individually, without any other test being executed before or after.
-[browser_allocations_reload.js]
+[browser_allocations_reload_debugger.js]
 skip-if = os != 'linux' || debug || asan # Results should be platform agnostic - only run on linux64-opt
rename from devtools/client/framework/test/allocations/browser_allocations_reload.js
rename to devtools/client/framework/test/allocations/browser_allocations_reload_debugger.js
--- a/devtools/client/framework/test/allocations/browser_allocations_reload.js
+++ b/devtools/client/framework/test/allocations/browser_allocations_reload_debugger.js
@@ -32,17 +32,17 @@ async function testScript(toolbox) {
 
   // eslint-disable-next-line mozilla/no-arbitrary-setTimeout
   await new Promise(resolve => setTimeout(resolve, 1000));
 }
 
 add_task(async function() {
   const tab = await addTab(TEST_URL);
   const toolbox = await gDevTools.showToolboxForTab(tab, {
-    toolId: "inspector",
+    toolId: "jsdebugger",
   });
 
   // Run the test scenario first before recording in order to load all the
   // modules. Otherwise they get reported as "still allocated" objects,
   // whereas we do expect them to be kept in memory as they are loaded via
   // the main DevTools loader, which keeps the module loaded until the
   // shutdown of Firefox
   await testScript(toolbox);
@@ -51,15 +51,15 @@ add_task(async function() {
     alsoRecordContentProcess: true,
   });
 
   // Now, run the test script. This time, we record this run.
   for (let i = 0; i < 10; i++) {
     await testScript(toolbox);
   }
 
-  await stopRecordingAllocations("reload", {
+  await stopRecordingAllocations("reload-debugger", {
     alsoRecordContentProcess: true,
   });
 
   await toolbox.destroy();
   gBrowser.removeTab(tab);
 });
copy from devtools/client/framework/test/allocations/browser_allocations_reload.ini
copy to devtools/client/framework/test/allocations/browser_allocations_reload_inspector.ini
--- a/devtools/client/framework/test/allocations/browser_allocations_reload.ini
+++ b/devtools/client/framework/test/allocations/browser_allocations_reload_inspector.ini
@@ -4,10 +4,10 @@ subsuite = devtools
 support-files =
   !/devtools/shared/test-helpers/allocation-tracker.js
   head.js
   reloaded-page.html
   reloaded.png
 
 # Each metrics tests is loaded in a separate .ini file. This way the test is executed
 # individually, without any other test being executed before or after.
-[browser_allocations_reload.js]
+[browser_allocations_reload_inspector.js]
 skip-if = os != 'linux' || debug || asan # Results should be platform agnostic - only run on linux64-opt
copy from devtools/client/framework/test/allocations/browser_allocations_reload.js
copy to devtools/client/framework/test/allocations/browser_allocations_reload_inspector.js
--- a/devtools/client/framework/test/allocations/browser_allocations_reload.js
+++ b/devtools/client/framework/test/allocations/browser_allocations_reload_inspector.js
@@ -51,15 +51,15 @@ add_task(async function() {
     alsoRecordContentProcess: true,
   });
 
   // Now, run the test script. This time, we record this run.
   for (let i = 0; i < 10; i++) {
     await testScript(toolbox);
   }
 
-  await stopRecordingAllocations("reload", {
+  await stopRecordingAllocations("reload-inspector", {
     alsoRecordContentProcess: true,
   });
 
   await toolbox.destroy();
   gBrowser.removeTab(tab);
 });
copy from devtools/client/framework/test/allocations/browser_allocations_reload.ini
copy to devtools/client/framework/test/allocations/browser_allocations_reload_netmonitor.ini
--- a/devtools/client/framework/test/allocations/browser_allocations_reload.ini
+++ b/devtools/client/framework/test/allocations/browser_allocations_reload_netmonitor.ini
@@ -4,10 +4,10 @@ subsuite = devtools
 support-files =
   !/devtools/shared/test-helpers/allocation-tracker.js
   head.js
   reloaded-page.html
   reloaded.png
 
 # Each metrics tests is loaded in a separate .ini file. This way the test is executed
 # individually, without any other test being executed before or after.
-[browser_allocations_reload.js]
+[browser_allocations_reload_netmonitor.js]
 skip-if = os != 'linux' || debug || asan # Results should be platform agnostic - only run on linux64-opt
copy from devtools/client/framework/test/allocations/browser_allocations_reload.js
copy to devtools/client/framework/test/allocations/browser_allocations_reload_netmonitor.js
--- a/devtools/client/framework/test/allocations/browser_allocations_reload.js
+++ b/devtools/client/framework/test/allocations/browser_allocations_reload_netmonitor.js
@@ -32,17 +32,17 @@ async function testScript(toolbox) {
 
   // eslint-disable-next-line mozilla/no-arbitrary-setTimeout
   await new Promise(resolve => setTimeout(resolve, 1000));
 }
 
 add_task(async function() {
   const tab = await addTab(TEST_URL);
   const toolbox = await gDevTools.showToolboxForTab(tab, {
-    toolId: "inspector",
+    toolId: "netmonitor",
   });
 
   // Run the test scenario first before recording in order to load all the
   // modules. Otherwise they get reported as "still allocated" objects,
   // whereas we do expect them to be kept in memory as they are loaded via
   // the main DevTools loader, which keeps the module loaded until the
   // shutdown of Firefox
   await testScript(toolbox);
@@ -51,15 +51,15 @@ add_task(async function() {
     alsoRecordContentProcess: true,
   });
 
   // Now, run the test script. This time, we record this run.
   for (let i = 0; i < 10; i++) {
     await testScript(toolbox);
   }
 
-  await stopRecordingAllocations("reload", {
+  await stopRecordingAllocations("reload-netmonitor", {
     alsoRecordContentProcess: true,
   });
 
   await toolbox.destroy();
   gBrowser.removeTab(tab);
 });
copy from devtools/client/framework/test/allocations/browser_allocations_reload.ini
copy to devtools/client/framework/test/allocations/browser_allocations_reload_webconsole.ini
--- a/devtools/client/framework/test/allocations/browser_allocations_reload.ini
+++ b/devtools/client/framework/test/allocations/browser_allocations_reload_webconsole.ini
@@ -4,10 +4,10 @@ subsuite = devtools
 support-files =
   !/devtools/shared/test-helpers/allocation-tracker.js
   head.js
   reloaded-page.html
   reloaded.png
 
 # Each metrics tests is loaded in a separate .ini file. This way the test is executed
 # individually, without any other test being executed before or after.
-[browser_allocations_reload.js]
+[browser_allocations_reload_webconsole.js]
 skip-if = os != 'linux' || debug || asan # Results should be platform agnostic - only run on linux64-opt
copy from devtools/client/framework/test/allocations/browser_allocations_reload.js
copy to devtools/client/framework/test/allocations/browser_allocations_reload_webconsole.js
--- a/devtools/client/framework/test/allocations/browser_allocations_reload.js
+++ b/devtools/client/framework/test/allocations/browser_allocations_reload_webconsole.js
@@ -32,17 +32,17 @@ async function testScript(toolbox) {
 
   // eslint-disable-next-line mozilla/no-arbitrary-setTimeout
   await new Promise(resolve => setTimeout(resolve, 1000));
 }
 
 add_task(async function() {
   const tab = await addTab(TEST_URL);
   const toolbox = await gDevTools.showToolboxForTab(tab, {
-    toolId: "inspector",
+    toolId: "webconsole",
   });
 
   // Run the test scenario first before recording in order to load all the
   // modules. Otherwise they get reported as "still allocated" objects,
   // whereas we do expect them to be kept in memory as they are loaded via
   // the main DevTools loader, which keeps the module loaded until the
   // shutdown of Firefox
   await testScript(toolbox);
@@ -51,15 +51,15 @@ add_task(async function() {
     alsoRecordContentProcess: true,
   });
 
   // Now, run the test script. This time, we record this run.
   for (let i = 0; i < 10; i++) {
     await testScript(toolbox);
   }
 
-  await stopRecordingAllocations("reload", {
+  await stopRecordingAllocations("reload-webconsole", {
     alsoRecordContentProcess: true,
   });
 
   await toolbox.destroy();
   gBrowser.removeTab(tab);
 });
new file mode 100644
--- /dev/null
+++ b/devtools/client/framework/test/allocations/moz.build
@@ -0,0 +1,15 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+BROWSER_CHROME_MANIFESTS += [
+    "browser_allocations_browser_console.ini",
+    "browser_allocations_reload_debugger.ini",
+    "browser_allocations_reload_inspector.ini",
+    "browser_allocations_reload_netmonitor.ini",
+    "browser_allocations_reload_webconsole.ini",
+    "browser_allocations_target.ini",
+    "browser_allocations_toolbox.ini",
+]