Skip to content

[wasm][debugger] Tests: Spawn MonoProxy in a separate process to avoid excessive memory usage for tests #95488

@radical

Description

@radical

Some debugger test runs randomly get aborted on CI. See #89409

Running GetPropertiesTests in codespaces reveals that the RES memory usage of the process keeps increasing, reaching ~10G in 5mins. This suggests a memory leak.

Looking at the test process with dotnet dotnet-counters monitor --refresh-interval 1 -p ...:

Screenshot 2023-11-30 at 17 42 52

One potential solution, and a good thing to do anyway would be to spawn MonoProxy in a separate process, for which we already have wrappers. Right now, we instantiate MonoProxy for each test in the same test process which is overkill and not representative of user scenarios.

relevant code

_debuggerProxy = new DebuggerProxy(loggerFactory, loggerId: Id, options: options);
TestHarnessProxy.RegisterNewProxy(Id, _debuggerProxy);
var browserUri = new Uri(con_str);
WebSocket? ideSocket = await context.WebSockets.AcceptWebSocketAsync().ConfigureAwait(false);
await _debuggerProxy.Run(browserUri, ideSocket, cts).ConfigureAwait(false);
}

cc @thaystg @ilonatommy

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-wasmWebAssembly architecturearea-Debugger-monoenhancementProduct code improvement that does NOT require public API changes/additions

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions