Backed out 4 changesets (bug 1745444) for GTest failures on IHistory.Test . CLOSED TREE

Backed out changeset b3a2dc754e16 (bug 1745444)
Backed out changeset 7b9d52dff930 (bug 1745444)
Backed out changeset 15d9a79cc305 (bug 1745444)
Backed out changeset 497572ee54af (bug 1745444)
This commit is contained in:
Narcis Beleuzu 2021-12-15 20:50:24 +02:00
parent 623627fafc
commit b80b92e2e1
21 changed files with 50 additions and 173 deletions

View File

@ -48,7 +48,6 @@
#include "mozilla/ipc/ProcessUtils.h"
#include "nsDebugImpl.h"
#include "nsIXULRuntime.h"
#include "nsThreadManager.h"
#if defined(MOZ_SANDBOX) && defined(MOZ_DEBUG) && defined(ENABLE_TESTS)
@ -273,7 +272,7 @@ mozilla::ipc::IPCResult RDDParent::RecvFlushFOGData(
mozilla::ipc::IPCResult RDDParent::RecvTestTriggerMetrics(
TestTriggerMetricsResolver&& aResolve) {
mozilla::glean::test_only_ipc::a_counter.Add(nsIXULRuntime::PROCESS_TYPE_RDD);
mozilla::glean::test_only_ipc::a_counter.Add(45327);
aResolve(true);
return IPC_OK();
}

View File

@ -58,7 +58,6 @@
#include "mozilla/webrender/WebRenderAPI.h"
#include "nsDebugImpl.h"
#include "nsIGfxInfo.h"
#include "nsIXULRuntime.h"
#include "nsThreadManager.h"
#include "nscore.h"
#include "prenv.h"
@ -626,10 +625,8 @@ mozilla::ipc::IPCResult GPUParent::RecvFlushFOGData(
return IPC_OK();
}
mozilla::ipc::IPCResult GPUParent::RecvTestTriggerMetrics(
TestTriggerMetricsResolver&& aResolve) {
mozilla::glean::test_only_ipc::a_counter.Add(nsIXULRuntime::PROCESS_TYPE_GPU);
aResolve(true);
mozilla::ipc::IPCResult GPUParent::RecvTestTriggerMetrics() {
mozilla::glean::test_only_ipc::a_counter.Add(45326);
return IPC_OK();
}

View File

@ -99,8 +99,7 @@ class GPUParent final : public PGPUParent {
mozilla::ipc::IPCResult RecvFlushFOGData(FlushFOGDataResolver&& aResolver);
mozilla::ipc::IPCResult RecvTestTriggerMetrics(
TestTriggerMetricsResolver&& aResolve);
mozilla::ipc::IPCResult RecvTestTriggerMetrics();
mozilla::ipc::IPCResult RecvCrashProcess();

View File

@ -1273,14 +1273,10 @@ RefPtr<MemoryReportingProcess> GPUProcessManager::GetProcessMemoryReporter() {
return new GPUMemoryReporter();
}
RefPtr<PGPUChild::TestTriggerMetricsPromise>
GPUProcessManager::TestTriggerMetrics() {
void GPUProcessManager::TestTriggerMetrics() {
if (!NS_WARN_IF(!mGPUChild)) {
return mGPUChild->SendTestTriggerMetrics();
mGPUChild->SendTestTriggerMetrics();
}
return PGPUChild::TestTriggerMetricsPromise::CreateAndReject(
ipc::ResponseRejectReason::SendError, __func__);
}
} // namespace gfx

View File

@ -12,7 +12,6 @@
#include "mozilla/UniquePtr.h"
#include "mozilla/dom/ipc/IdType.h"
#include "mozilla/gfx/GPUProcessHost.h"
#include "mozilla/gfx/PGPUChild.h"
#include "mozilla/gfx/Point.h"
#include "mozilla/ipc/ProtocolUtils.h"
#include "mozilla/ipc/TaskFactory.h"
@ -201,7 +200,7 @@ class GPUProcessManager final : public GPUProcessHost::Listener {
*
* Trigger GPU-process test metric instrumentation.
*/
RefPtr<PGPUChild::TestTriggerMetricsPromise> TestTriggerMetrics();
void TestTriggerMetrics();
private:
// Called from our xpcom-shutdown observer.

View File

@ -120,8 +120,7 @@ parent:
// Test-only method.
// Asks the gpu process to trigger test-only instrumentation.
// The unused returned value is to have a promise we can await.
async TestTriggerMetrics() returns (bool unused);
async TestTriggerMetrics();
// Causes the GPU process to crash. Used for tests and diagnostics.
async CrashProcess();

View File

@ -31,8 +31,6 @@ include NeckoChannelParams;
include PrefsTypes;
include PSMIPCTypes;
include "mozilla/ipc/ByteBufUtils.h";
using mozilla::dom::NativeThreadId from "mozilla/dom/NativeThreadId.h";
using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";
using mozilla::Telemetry::HistogramAccumulation from "mozilla/TelemetryComms.h";
@ -142,11 +140,6 @@ parent:
async OnConsoleMessage(nsString aMessage);
// Sent from time-to-time to limit the amount of telemetry vulnerable to loss
// Buffer contains bincoded Rust structs.
// https://firefox-source-docs.mozilla.org/toolkit/components/glean/dev/ipc.html
async FOGData(ByteBuf buf);
child:
async Init(SocketPorcessInitAttributes aAttributes);
async PreferenceUpdate(Pref pref);
@ -197,16 +190,6 @@ child:
async RecheckIPConnectivity();
async RecheckDNS();
// Tells the Socket process to flush any pending telemetry.
// Used in tests and ping assembly. Buffer contains bincoded Rust structs.
// https://firefox-source-docs.mozilla.org/toolkit/components/glean/dev/ipc.html
async FlushFOGData() returns (ByteBuf buf);
// Test-only method.
// Asks the Socket process to trigger test-only instrumentation.
// The unused returned value is to have a promise we can await.
async TestTriggerMetrics() returns (bool unused);
both:
async PFileDescriptorSet(FileDescriptor fd);
async PDNSRequest(nsCString hostName, nsCString trrServer, uint16_t type,

View File

@ -15,8 +15,6 @@
#include "mozilla/Atomics.h"
#include "mozilla/Components.h"
#include "mozilla/dom/MemoryReportRequest.h"
#include "mozilla/FOGIPC.h"
#include "mozilla/glean/GleanMetrics.h"
#include "mozilla/ipc/CrashReporterClient.h"
#include "mozilla/ipc/BackgroundChild.h"
#include "mozilla/ipc/BackgroundParent.h"
@ -43,7 +41,6 @@
#include "nsHttpHandler.h"
#include "nsIDNSService.h"
#include "nsIHttpActivityObserver.h"
#include "nsIXULRuntime.h"
#include "nsNetUtil.h"
#include "nsNSSComponent.h"
#include "nsSocketTransportService2.h"
@ -181,10 +178,6 @@ void SocketProcessChild::ActorDestroy(ActorDestroyReason aWhy) {
ProcessChild::QuickExit();
}
// Send the last bits of Glean data over to the main process.
glean::FlushFOGData(
[](ByteBuf&& aBuf) { glean::SendFOGData(std::move(aBuf)); });
if (mProfilerController) {
mProfilerController->Shutdown();
mProfilerController = nullptr;
@ -673,19 +666,5 @@ mozilla::ipc::IPCResult SocketProcessChild::RecvRecheckDNS() {
return IPC_OK();
}
mozilla::ipc::IPCResult SocketProcessChild::RecvFlushFOGData(
FlushFOGDataResolver&& aResolver) {
glean::FlushFOGData(std::move(aResolver));
return IPC_OK();
}
mozilla::ipc::IPCResult SocketProcessChild::RecvTestTriggerMetrics(
TestTriggerMetricsResolver&& aResolve) {
mozilla::glean::test_only_ipc::a_counter.Add(
nsIXULRuntime::PROCESS_TYPE_SOCKET);
aResolve(true);
return IPC_OK();
}
} // namespace net
} // namespace mozilla

View File

@ -148,11 +148,6 @@ class SocketProcessChild final
mozilla::ipc::IPCResult RecvRecheckIPConnectivity();
mozilla::ipc::IPCResult RecvRecheckDNS();
mozilla::ipc::IPCResult RecvFlushFOGData(FlushFOGDataResolver&& aResolver);
mozilla::ipc::IPCResult RecvTestTriggerMetrics(
TestTriggerMetricsResolver&& aResolve);
protected:
friend class SocketProcessImpl;
~SocketProcessChild();

View File

@ -12,7 +12,6 @@
#include "SocketProcessHost.h"
#include "mozilla/Components.h"
#include "mozilla/dom/MemoryReportRequest.h"
#include "mozilla/FOGIPC.h"
#include "mozilla/ipc/FileDescriptorSetParent.h"
#include "mozilla/ipc/IPCStreamAlloc.h"
#include "mozilla/ipc/PChildToParentStreamParent.h"
@ -471,10 +470,5 @@ mozilla::ipc::IPCResult SocketProcessParent::RecvOnConsoleMessage(
return IPC_OK();
}
mozilla::ipc::IPCResult SocketProcessParent::RecvFOGData(ByteBuf&& aBuf) {
glean::FOGData(std::move(aBuf));
return IPC_OK();
}
} // namespace net
} // namespace mozilla

View File

@ -125,8 +125,6 @@ class SocketProcessParent final
const HttpConnectionInfoCloneArgs& aArgs);
mozilla::ipc::IPCResult RecvOnConsoleMessage(const nsString& aMessage);
mozilla::ipc::IPCResult RecvFOGData(ByteBuf&& aBuf);
private:
SocketProcessHost* mHost;
UniquePtr<dom::MemoryReportRequestHost> mMemoryReportRequest;

View File

@ -122,9 +122,6 @@ fn register_process_shutdown(process_type: u32) {
nsIXULRuntime::PROCESS_TYPE_RDD => {
// RDD process shutdown is handled in RDDParent::ActorDestroy.
}
nsIXULRuntime::PROCESS_TYPE_SOCKET => {
// Socket process shutdown is handled in SocketProcessChild::ActorDestroy.
}
_ => {
// We don't yet support other process types.
log::error!("Process type {} tried to use FOG, but isn't supported! (Process type constants are in nsIXULRuntime.rs)", process_type);

View File

@ -138,7 +138,6 @@ FOG supports messaging between the following types of child process and the pare
(for now. See [bug 1641989](https://bugzilla.mozilla.org/show_bug.cgi?id=1641989))
* gpu children (via `PGPU`)
* rdd children (via `PRDD`)
* socket children (via `PSocketProcess`)
See
[the process model docs](../../../../dom/ipc/process_model.html)

View File

@ -14,14 +14,11 @@
#include "mozilla/gfx/GPUParent.h"
#include "mozilla/gfx/GPUProcessManager.h"
#include "mozilla/MozPromise.h"
#include "mozilla/net/SocketProcessChild.h"
#include "mozilla/net/SocketProcessParent.h"
#include "mozilla/ProcInfo.h"
#include "mozilla/RDDChild.h"
#include "mozilla/RDDParent.h"
#include "mozilla/RDDProcessManager.h"
#include "mozilla/Unused.h"
#include "nsIXULRuntime.h"
#include "nsTArray.h"
#include "nsThreadUtils.h"
@ -115,11 +112,6 @@ void FlushAllChildData(
}
}
if (net::SocketProcessParent* socketParent =
net::SocketProcessParent::GetSingleton()) {
promises.EmplaceBack(socketParent->SendFlushFOGData());
}
if (promises.Length() == 0) {
// No child processes at the moment. Resolve synchronously.
fog_ipc::flush_durations.Cancel(std::move(timerId));
@ -173,10 +165,6 @@ void SendFOGData(ipc::ByteBuf&& buf) {
case GeckoProcessType_RDD:
Unused << mozilla::RDDParent::GetSingleton()->SendFOGData(std::move(buf));
break;
case GeckoProcessType_Socket:
Unused << net::SocketProcessChild::GetSingleton()->SendFOGData(
std::move(buf));
break;
default:
MOZ_ASSERT_UNREACHABLE("Unsuppored process type");
}
@ -203,33 +191,15 @@ RefPtr<GenericPromise> FlushAndUseFOGData() {
return ret;
}
void TestTriggerMetrics(uint32_t aProcessType,
const RefPtr<dom::Promise>& promise) {
switch (aProcessType) {
case nsIXULRuntime::PROCESS_TYPE_GPU:
gfx::GPUProcessManager::Get()->TestTriggerMetrics()->Then(
GetCurrentSerialEventTarget(), __func__,
[promise]() { promise->MaybeResolveWithUndefined(); },
[promise]() { promise->MaybeRejectWithUndefined(); });
break;
case nsIXULRuntime::PROCESS_TYPE_RDD:
RDDProcessManager::Get()->TestTriggerMetrics()->Then(
GetCurrentSerialEventTarget(), __func__,
[promise]() { promise->MaybeResolveWithUndefined(); },
[promise]() { promise->MaybeRejectWithUndefined(); });
break;
case nsIXULRuntime::PROCESS_TYPE_SOCKET:
Unused << net::SocketProcessParent::GetSingleton()
->SendTestTriggerMetrics()
->Then(
GetCurrentSerialEventTarget(), __func__,
[promise]() { promise->MaybeResolveWithUndefined(); },
[promise]() { promise->MaybeRejectWithUndefined(); });
break;
default:
promise->MaybeRejectWithUndefined();
break;
}
void TestTriggerGPUMetrics() {
gfx::GPUProcessManager::Get()->TestTriggerMetrics();
}
void TestTriggerRDDMetrics(const RefPtr<dom::Promise>& promise) {
RDDProcessManager::Get()->TestTriggerMetrics()->Then(
GetCurrentSerialEventTarget(), __func__,
[promise]() { promise->MaybeResolveWithUndefined(); },
[promise]() { promise->MaybeRejectWithUndefined(); });
}
} // namespace glean

View File

@ -62,14 +62,19 @@ RefPtr<GenericPromise> FlushAndUseFOGData();
/**
* ** Test-only Method **
*
* Trigger GPU, RDD or Socket process test instrumentation.
*
* @param processType - one of the PROCESS_TYPE_* constants from nsIXULRuntime.
* @param promise - a promise that will be resolved when the data has made it to
* the target process.
* Trigger GPU-process test instrumentation.
*/
void TestTriggerMetrics(uint32_t processType,
const RefPtr<dom::Promise>& promise);
void TestTriggerGPUMetrics();
/**
* ** Test-only Method **
*
* Trigger RDD-process test instrumentation.
*
* @param promise - a promise that will be resolved when the data has made it to
* the RDD process.
*/
void TestTriggerRDDMetrics(const RefPtr<dom::Promise>& promise);
} // namespace glean
} // namespace mozilla

View File

@ -1,10 +1,6 @@
# Please keep test files lexicographically sorted, with whitespace between.
[DEFAULT]
support-files =
[browser_fog_gpu.js]
[browser_fog_rdd.js]
support-files = small-shot.ogg
[browser_fog_socket.js]

View File

@ -26,12 +26,12 @@ add_task(async () => {
"Ensure we begin without value."
);
await Services.fog.testTriggerMetrics(Ci.nsIXULRuntime.PROCESS_TYPE_GPU);
Services.fog.testTriggerGPUMetrics();
await Services.fog.testFlushAllChildren();
is(
45326, // See gfx/ipc/GPUParent.cpp's RecvTestTriggerMetrics().
Glean.testOnlyIpc.aCounter.testGetValue(),
Ci.nsIXULRuntime.PROCESS_TYPE_GPU,
"Ensure the GPU-process-set value shows up in the parent process."
);
});

View File

@ -47,7 +47,7 @@ add_task(async () => {
await TestUtils.waitForCondition(async () => {
try {
await Services.fog.testTriggerMetrics(Ci.nsIXULRuntime.PROCESS_TYPE_RDD);
await Services.fog.testTriggerRDDMetrics();
return true;
} catch (e) {
return false;
@ -57,8 +57,8 @@ add_task(async () => {
await Services.fog.testFlushAllChildren();
is(
45327, // See dom/media/ipc/RDDParent.cpp's RecvTestTriggerMetrics().
Glean.testOnlyIpc.aCounter.testGetValue(),
Ci.nsIXULRuntime.PROCESS_TYPE_RDD,
"Ensure the RDD-process-set value shows up in the parent process."
);

View File

@ -1,36 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Glean's here on `window`, but eslint doesn't know that. bug 1715542.
/* global Glean:false */
add_task(async () => {
if (
!(await ChromeUtils.requestProcInfo()).children.some(
p => p.type == "socket"
)
) {
ok(true, "No Socket process? No test.");
return;
}
ok(true, "Socket process found: Let's test.");
Services.fog.testResetFOG();
is(
undefined,
Glean.testOnlyIpc.aCounter.testGetValue(),
"Ensure we begin without value."
);
await Services.fog.testTriggerMetrics(Ci.nsIXULRuntime.PROCESS_TYPE_SOCKET);
await Services.fog.testFlushAllChildren();
is(
Glean.testOnlyIpc.aCounter.testGetValue(),
Ci.nsIXULRuntime.PROCESS_TYPE_SOCKET,
"Ensure the Socket-process-set value shows up in the parent process."
);
});

View File

@ -299,8 +299,14 @@ FOG::TestResetFOG(const nsACString& aDataPathOverride,
}
NS_IMETHODIMP
FOG::TestTriggerMetrics(uint32_t aProcessType, JSContext* aCx,
mozilla::dom::Promise** aOutPromise) {
FOG::TestTriggerGPUMetrics() {
glean::TestTriggerGPUMetrics();
return NS_OK;
}
NS_IMETHODIMP
FOG::TestTriggerRDDMetrics(JSContext* aCx,
mozilla::dom::Promise** aOutPromise) {
NS_ENSURE_ARG(aOutPromise);
*aOutPromise = nullptr;
nsIGlobalObject* global = xpc::CurrentNativeGlobal(aCx);
@ -314,7 +320,7 @@ FOG::TestTriggerMetrics(uint32_t aProcessType, JSContext* aCx,
return erv.StealNSResult();
}
glean::TestTriggerMetrics(aProcessType, promise);
glean::TestTriggerRDDMetrics(promise);
promise.forget(aOutPromise);
return NS_OK;

View File

@ -122,15 +122,17 @@ interface nsIFOG : nsISupports
/**
* ** Test-only Method **
*
* Trigger test metric instrumentation on the GPU, RDD or Socket process.
* Trigger test metric instrumentation on the GPU process.
*/
void testTriggerGPUMetrics();
/**
* ** Test-only Method **
*
* @param aProcessType - A PROCESS_TYPE_* value from the constants defined
* in the nsIXULRuntime interface.
* Trigger test metric instrumentation on the RDD process.
*
* @returns A promise that resolves when the test data has been added.
* The promise will be rejected if the process type is not supported
* or if sending the IPC to the child process fails.
*/
[implicit_jscontext]
Promise testTriggerMetrics(in unsigned long aProcessType);
Promise testTriggerRDDMetrics();
};