Skip to content

UnitTestRunner "leaks" Test Class instances #5711

@RobSwDev

Description

@RobSwDev

Describe the bug

We're running 5k tests and suffering from memory leaks.
Part of the problem is that we have a long-established pattern of storing lots of transient data on the test class instance.
While the test is running (or being cleaned-up) the data is required. But once the test is finished, it can all be collected.

Unfortunately, one instance of each test class appears to be held in UnitTestRunner._fixtureTests, and I don't see any code paths that remove items from this concurrent dictionary.
Shouldn't there be some mechanism for clearing these up once all the fixtures in a class have run?

Metadata

Metadata

Assignees

Labels

Area: MSTestIssues with MSTest that are not specific to more refined area (e.g. analyzers or assertions)Area: Performance

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions