dotnet / docfx

Static site generator for .NET API documentation.
https://dotnet.github.io/docfx/
MIT License
4.09k stars 866 forks source link

fix: NullReferenceException thrown when running tests in parallel #10181

Closed filzrev closed 2 months ago

filzrev commented 2 months ago

When running unit tests on Visual Studio TestExplorer. NullReferenceException is thrown on some cases.

It's seems to be occurred when running following tests in parallel.

  1. UnitTest that use new TestListenerScope();
  2. UnitTest that try to write logs.

How to reproduce problems

  1. Select following tests on Visual Studio TestExplorer. 1.1. TestLoaderWhenStandalonePreprocessorExists 1.2. TestBadMdToc
  2. Run unit tests.