Bug 1380081 - Part 15: Don't try to submit bhr ping to telemetry while running tests, r=chutten

This commit is contained in:
Michael Layzell 2017-08-15 14:07:31 -04:00
Родитель 7f649507e9
Коммит 4c4a03953d
3 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -1502,6 +1502,8 @@ pref("toolkit.telemetry.shutdownPingSender.enabledFirstSession", false);
pref("toolkit.telemetry.newProfilePing.enabled", true);
// Enables sending 'update' pings on Firefox updates.
pref("toolkit.telemetry.updatePing.enabled", true);
// Enables sending 'bhr' pings when the browser hangs.
pref("toolkit.telemetry.bhrPing.enabled", true);
// Telemetry experiments settings.
pref("experiments.enabled", true);

Просмотреть файл

@ -254,6 +254,9 @@ user_pref("toolkit.telemetry.server", "https://%(server)s/telemetry-dummy/");
// Don't send 'new-profile' ping on new profiles during tests, otherwise the testing framework
// might wait on the pingsender to finish and slow down tests.
user_pref("toolkit.telemetry.newProfilePing.enabled", false);
// Don't send 'bhr' ping during tests, otherwise the testing framework might
// wait on the pingsender to finish and slow down tests.
user_pref("toolkit.telemetry.bhrPing.enabled", false);
// Don't send the 'shutdown' ping using the pingsender on the first session using
// the 'pingsender' process. Valgrind marks the process as leaky (e.g. see bug 1364068
// for the 'new-profile' ping) but does not provide enough information

Просмотреть файл

@ -82,7 +82,12 @@ BHRTelemetryService.prototype = Object.freeze({
return;
}
if (this.payload.hangs.length >= 0) {
// NOTE: We check a separate bhrPing.enabled pref here. This pref is unset
// when running tests so that we run as much of BHR as possible (to catch
// errors) while avoiding timeouts caused by invoking `pingsender` during
// testing.
if (Services.prefs.getBoolPref("toolkit.telemetry.bhrPing.enabled", false) &&
this.payload.hangs.length > 0) {
TelemetryController.submitExternalPing("bhr", this.payload, {
addEnvironment: true,
});