Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TraceListenerManager is not thread safe #2616

Open
MarcoRossignoli opened this issue Mar 20, 2024 · 0 comments
Open

TraceListenerManager is not thread safe #2616

MarcoRossignoli opened this issue Mar 20, 2024 · 0 comments

Comments

@MarcoRossignoli
Copy link
Contributor

MarcoRossignoli commented Mar 20, 2024

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);

@MarcoRossignoli MarcoRossignoli changed the title TraceListnerManager is not thread safe TraceListenerManager is not thread safe Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant