Skip to content

Commit 3cad835

Browse files
author
Gregory Mierzwinski
committed
Bug 1717445 - Allow non-local connections when running condprof. r=perftest-reviewers,AlexandruIonescu
This patch enables non-local connections when we are running condprof to obtain a conditioned profile. The only reason these connections are being disabled to begin with is because of the web-extension we use. This fixes an issue with using the condprofs in release builds such as beta. Differential Revision: https://phabricator.services.mozilla.com/D119304
1 parent 08389c6 commit 3cad835

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

testing/raptor/raptor/perftest.py

+20
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,11 @@ def build_conditioned_profile(self):
269269
force_new=True,
270270
skip_logs=True,
271271
)
272+
273+
if self.config.get("is_release_build", False):
274+
# Enable non-local connections for building the conditioned profile
275+
self.enable_non_local_connections()
276+
272277
if scenario == "settled-youtube":
273278
runner.prepare(scenario, "youtube")
274279

@@ -280,6 +285,9 @@ def build_conditioned_profile(self):
280285
loop = asyncio.get_event_loop()
281286
loop.run_until_complete(runner.one_run(scenario, "default"))
282287

288+
if self.config.get("is_release_build", False):
289+
self.disable_non_local_connections()
290+
283291
self.conditioned_profile_dir = runner.env.profile
284292
return self.conditioned_profile_copy
285293

@@ -587,6 +595,18 @@ def _init_gecko_profiling(self, test):
587595
else:
588596
self.gecko_profiler = GeckoProfile(upload_dir, self.config, test)
589597

598+
def disable_non_local_connections(self):
599+
# For Firefox we need to set MOZ_DISABLE_NONLOCAL_CONNECTIONS=1 env var before startup
600+
# when testing release builds from mozilla-beta/release. This is because of restrictions
601+
# on release builds that require webextensions to be signed unless this env var is set
602+
LOG.info("setting MOZ_DISABLE_NONLOCAL_CONNECTIONS=1")
603+
os.environ["MOZ_DISABLE_NONLOCAL_CONNECTIONS"] = "1"
604+
605+
def enable_non_local_connections(self):
606+
# pageload tests need to be able to access non-local connections via mitmproxy
607+
LOG.info("setting MOZ_DISABLE_NONLOCAL_CONNECTIONS=0")
608+
os.environ["MOZ_DISABLE_NONLOCAL_CONNECTIONS"] = "0"
609+
590610

591611
class PerftestAndroid(Perftest):
592612
"""Mixin class for Android-specific Perftest subclasses."""

testing/raptor/raptor/webextension/desktop.py

-12
Original file line numberDiff line numberDiff line change
@@ -223,18 +223,6 @@ def clean_up(self):
223223

224224

225225
class WebExtensionFirefox(WebExtensionDesktop):
226-
def disable_non_local_connections(self):
227-
# For Firefox we need to set MOZ_DISABLE_NONLOCAL_CONNECTIONS=1 env var before startup
228-
# when testing release builds from mozilla-beta/release. This is because of restrictions
229-
# on release builds that require webextensions to be signed unless this env var is set
230-
LOG.info("setting MOZ_DISABLE_NONLOCAL_CONNECTIONS=1")
231-
os.environ["MOZ_DISABLE_NONLOCAL_CONNECTIONS"] = "1"
232-
233-
def enable_non_local_connections(self):
234-
# pageload tests need to be able to access non-local connections via mitmproxy
235-
LOG.info("setting MOZ_DISABLE_NONLOCAL_CONNECTIONS=0")
236-
os.environ["MOZ_DISABLE_NONLOCAL_CONNECTIONS"] = "0"
237-
238226
def launch_desktop_browser(self, test):
239227
LOG.info("starting %s" % self.config["app"])
240228
if self.config["is_release_build"]:

0 commit comments

Comments
 (0)