Backed out changeset e8751087ba26 (bug 1746983) for causing regressions. a=backout

This commit is contained in:
Cosmin Sabou 2022-05-17 00:56:55 +03:00
Родитель 17d77a6555
Коммит 24c1cdc33c
6 изменённых файлов: 38 добавлений и 26 удалений

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

@ -1682,14 +1682,12 @@ var TelemetrySendImpl = {
}
const exeName =
AppConstants.MOZ_APP_NAME +
(AppConstants.platform === "win" ? ".exe" : "");
AppConstants.platform === "win" ? "pingsender.exe" : "pingsender";
let exe = Services.dirsvc.get("GreBinD", Ci.nsIFile);
exe.append(exeName);
let params = ["--backgroundtask", "pingsender"];
params.push(...pings.flatMap(ping => [ping.url, ping.path]));
let params = pings.flatMap(ping => [ping.url, ping.path]);
let process = Cc["@mozilla.org/process/util;1"].createInstance(
Ci.nsIProcess
);

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

@ -307,8 +307,14 @@ add_task(async function test_discardedForSizePending() {
});
add_task(async function test_usePingSenderOnShutdown() {
if (gIsAndroid) {
if (
gIsAndroid ||
(AppConstants.platform == "linux" && OS.Constants.Sys.bits == 32)
) {
// We don't support the pingsender on Android, yet, see bug 1335917.
// We also don't support the pingsender testing on Treeherder for
// Linux 32 bit (due to missing libraries). So skip it there too.
// See bug 1310703 comment 78.
return;
}
@ -340,12 +346,12 @@ add_task(async function test_usePingSenderOnShutdown() {
// Check that the health ping is sent at shutdown using the pingsender.
Assert.equal(
request.getHeader("User-Agent"),
"pingsender/2.0",
"pingsender/1.0",
"Should have received the correct user agent string."
);
Assert.equal(
request.getHeader("X-PingSender-Version"),
"2.0",
"1.0",
"Should have received the correct PingSender version string."
);
});

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

@ -89,8 +89,6 @@ add_task(async function setup() {
});
add_task(async function test_pingSender() {
let count = 10;
// Generate a new ping and save it among the pending pings.
const data = generateTestPingData();
await TelemetryStorage.savePing(data, true);
@ -99,8 +97,8 @@ add_task(async function test_pingSender() {
const pingPath = OS.Path.join(TelemetryStorage.pingDirectoryPath, data.id);
// Spawn an HTTP server that returns an error. We will be running the
// PingSender multiple times, trying to send the ping to this server. After the
// last time, we will resolve |deferred404Hit|.
// PingSender twice, trying to send the ping to this server. After the
// second time, we will resolve |deferred404Hit|.
let failingServer = new HttpServer();
let deferred404Hit = PromiseUtils.defer();
let hitCount = 0;
@ -108,23 +106,21 @@ add_task(async function test_pingSender() {
response.setStatusLine("1.1", 404, "Not Found");
hitCount++;
if (hitCount >= count) {
if (hitCount >= 2) {
// Resolve the promise on the next tick.
Services.tm.dispatchToMainThread(() => deferred404Hit.resolve());
}
});
failingServer.start(-1);
// Try to send the ping multiple times using the pingsender (we expect 404 every time).
// Try to send the ping twice using the pingsender (we expect 404 both times).
const errorUrl =
"http://localhost:" + failingServer.identity.primaryPort + "/lookup_fail";
TelemetrySend.testRunPingSender([{ url: errorUrl, path: pingPath }]);
TelemetrySend.testRunPingSender([{ url: errorUrl, path: pingPath }]);
for (let i = 0; i < count; i++) {
TelemetrySend.testRunPingSender([{ url: errorUrl, path: pingPath }]);
}
// Wait until we hit the 404 server enough times. After that, make sure that the pings
// still exist locally.
// Wait until we hit the 404 server twice. After that, make sure that the ping
// still exists locally.
await deferred404Hit.promise;
Assert.ok(
await OS.File.exists(pingPath),
@ -139,12 +135,12 @@ add_task(async function test_pingSender() {
Assert.equal(
req.getHeader("User-Agent"),
"pingsender/2.0",
"pingsender/1.0",
"Should have received the correct user agent string."
);
Assert.equal(
req.getHeader("X-PingSender-Version"),
"2.0",
"1.0",
"Should have received the correct PingSender version string."
);
Assert.equal(

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

@ -682,8 +682,14 @@ add_task(async function test_telemetryCleanFHRDatabase() {
});
add_task(async function test_sendNewProfile() {
if (gIsAndroid) {
if (
gIsAndroid ||
(AppConstants.platform == "linux" && OS.Constants.Sys.bits == 32)
) {
// We don't support the pingsender on Android, yet, see bug 1335917.
// We also don't suppor the pingsender testing on Treeherder for
// Linux 32 bit (due to missing libraries). So skip it there too.
// See bug 1310703 comment 78.
return;
}
@ -756,12 +762,12 @@ add_task(async function test_sendNewProfile() {
// Check that the new-profile ping is sent at shutdown using the pingsender.
Assert.equal(
req.getHeader("User-Agent"),
"pingsender/2.0",
"pingsender/1.0",
"Should have received the correct user agent string."
);
Assert.equal(
req.getHeader("X-PingSender-Version"),
"2.0",
"1.0",
"Should have received the correct PingSender version string."
);

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

@ -1235,8 +1235,14 @@ add_task(async function test_savedPingsOnShutdown() {
});
add_task(async function test_sendShutdownPing() {
if (gIsAndroid) {
if (
gIsAndroid ||
(AppConstants.platform == "linux" && OS.Constants.Sys.bits == 32)
) {
// We don't support the pingsender on Android, yet, see bug 1335917.
// We also don't suppor the pingsender testing on Treeherder for
// Linux 32 bit (due to missing libraries). So skip it there too.
// See bug 1310703 comment 78.
return;
}

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

@ -92,7 +92,7 @@ skip-if =
apple_silicon # bug 1707747
apple_catalina # Bug 1713329
[test_PingSender.js]
skip-if = os == "android" # pingsender is disabled on Android in TelemetrySend.jsm
skip-if = (os == "android") || (os == "linux" && bits == 32)
[test_TelemetryAndroidEnvironment.js]
[test_TelemetryUtils.js]
[test_ThirdPartyModulesPing.js]