Skip to content

TraceListenerManager is not thread safe #2616

@MarcoRossignoli

Description

@MarcoRossignoli

TraceListenerManager can be created in parallel and in the constructor it's setting the static console TextWriter without any lock. So when for instance one test completes and restores the original TextWriter another concurrent Console.WriteLine will pickup wrong writer invalidating the "capture" semantic.

Console.SetOut(outputWriter);
Console.SetError(errorWriter);

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions