TrxReport keeps all test nodes in memory
We keep a list of TestNodeUpdateMessage in memory for TrxReport to generate the report at the end of the test run.
I wonder if we can write to file stream as we get the info and whether it improves Trx perf.
Do you have links to how that is happening? I thought we already write to the file directly, to be more resilient to crash when running the logger in process.
@nohwnd We keep collecting the test nodes in memory here:
https://github.com/microsoft/testfx/blob/85128834dc5707bd3f92ddbeeb77bcc4f9fae300/src/Platform/Microsoft.Testing.Extensions.TrxReport/TrxDataConsumer.cs#L42
Then only in OnTestSessionFinishingAsync we will start do something with them.
https://github.com/microsoft/testfx/blob/85128834dc5707bd3f92ddbeeb77bcc4f9fae300/src/Platform/Microsoft.Testing.Extensions.TrxReport/TrxDataConsumer.cs#L229-L232
👍 thx, I thought it is more clever. It would be nice to experiment with a way to write directly to file, and how performant it would be. Especially if the report needs some closing string.
OR at least we could start by writing a file for the report with a failure, and then collect in memory, and then re-write the file. So we get at least a generic failure result when the process crashes and fails to write anything.