We need to do similar change in testfx as done in https://github.com/dotnet/sdk/pull/50975 for the TerminalTestReporter.