Skip to content

Log collection is broken, >20 GB RAM usage for simple project #7846

@MichelZ

Description

@MichelZ

Describe the bug

We have issues with a project, where the test project takes up huge amounts of RAM and eventually crashes.
We have "traced" this back to some broken logging.
It seems that (for DynamicData tests), logs are collected wrongly.
Each subsequent test from the DynamicData contains ALL logs from ALL previous invocations in the TEST SUMMARY where all logs are collected and presented at once.

Evidence:
Proper log when you look at a single test:

Image

However when you open the "summary" log, the same test shows ALL OTHER logs first.
We would not expect CONSOLE_0_0 to see in the TestMethod1 (100) logs. It should also start with CONSOLE_100_0 like the individual test's log above.

Image

The test was 1000 DynamicData tests, each test has 1000 iterations logging 2 lines, so we'd expect around 2'000'000 lines of logs give or take, however the log file has over 12'000'000 lines (and seems to be truncated after around test 110)

Something is VERY wrong and it causes us a lot of test weirdness.

Version used

We are using MTP/MSTest via MSTest.SDK 4.2.1

Steps To Reproduce

A repro project is attached. Just try to open the test results in VS (April 2026 version if that makes a difference) and you'll see :)

mstestRAM.zip

Expected behavior

Not so much RAM in use, and logs collected correctly

Actual behavior

Too much RAM in use, and summary logs collected wrongly

Image

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions