commit 961bc8802f08ee81e213f3e3e786b97cfa8597c9
parent 2fb01a56fc98fe55c5558c6703a74362b21603ed
Author: Landry Breuil <landry@openbsd.org>
Date: Wed, 3 Dec 2025 07:45:30 +0000
Bug 1984321 - Don't crash xpcshell tests on OpenBSD after bug #1970116 r=florian
the profiler isn't built on OpenBSD and Solaris, and dereferencing
Services.profiler without checking it first gives a hard crash in the js
engine. While ideally the profiler should be available everywhere, in the
meantime this allows running xpcshell tests on OpenBSD again.
Differential Revision: https://phabricator.services.mozilla.com/D274766
Diffstat:
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/testing/xpcshell/head.js b/testing/xpcshell/head.js
@@ -627,7 +627,9 @@ function _execute_test() {
let timer;
if (
- Services.profiler.IsActive() &&
+ // Services.profiler is missing on some tier3 platforms where
+ // MOZ_GECKO_PROFILER is not set.
+ Services.profiler?.IsActive() &&
!Services.env.exists("MOZ_PROFILER_SHUTDOWN") &&
Services.env.exists("MOZ_UPLOAD_DIR") &&
Services.env.exists("MOZ_TEST_TIMEOUT_INTERVAL")
diff --git a/xpcom/tests/unit/test_getTimers.js b/xpcom/tests/unit/test_getTimers.js
@@ -38,7 +38,9 @@ if (AppConstants.platform == "win") {
ignoredTimers.push("nsAnonTempFileRemover");
}
if (
- Services.profiler.IsActive() &&
+ // Services.profiler is missing on some tier3 platforms where
+ // MOZ_GECKO_PROFILER is not set.
+ Services.profiler?.IsActive() &&
!Services.env.exists("MOZ_PROFILER_SHUTDOWN") &&
Services.env.exists("MOZ_UPLOAD_DIR") &&
Services.env.exists("MOZ_TEST_TIMEOUT_INTERVAL")