Skip to content

TrxReport keeps all test nodes in memory #5774

Closed

Description

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.

Activity

  1. added
    area/mtp
    area/trx
    area/performance
    on Jun 14, 2025
  2. nohwnd commented on Jun 16, 2025

    @nohwnd
    Member

    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.

  3. Youssef1313 commented on Jun 16, 2025

    @Youssef1313
    MemberAuthor

    Jakub Jareš (@nohwnd) We keep collecting the test nodes in memory here:

    private readonly List<TestNodeUpdateMessage> _tests = [];

    Then only in OnTestSessionFinishingAsync we will start do something with them.

    TrxReportEngine trxReportGeneratorEngine = new(_testApplicationModuleInfo, _environment, _commandLineOptionsService, _configuration,
    _clock, [.. _tests], _failedTestsCount, _passedTestsCount, _notExecutedTestsCount, _timeoutTestsCount, _artifactsByExtension,
    _adapterSupportTrxCapability, _testFramework, _testStartTime.Value, exitCode, cancellationToken);
    (string reportFileName, string? warning) = await trxReportGeneratorEngine.GenerateReportAsync().ConfigureAwait(false);

  4. nohwnd commented on Jun 16, 2025

    @nohwnd
    Member

    👍 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/mtparea/performancearea/trx

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions