Skip to content

[BUG]: OutOfMemoryException from TrxResultParser with MTP v2 #22092

@Coder3333

Description

@Coder3333

New issue checklist

Task name

DotNetCoreCLI@2

Task version

2

Issue Description

TrxResultParser throws OutOfMemoryException with MTP v2. This same project processes fine with VSTest, using the equivalent of the same parameters.

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Windows

Relevant log output

F:\agent10\_work\_tool\dotnet8\dotnet.exe test --project F:\agent10\_work\1\s\MyProj.csproj --report-trx --results-directory F:\agent10\_work\_temp --coverage --coverage-settings runsettings.runsettings -c:release --no-restore

Test run summary: Failed!
  error: 1

  total: 93
  failed: 0
  succeeded: 93
  skipped: 0
  duration: 11m 04s 439ms
Test run completed with non-success exit code: 1 (see: https://aka.ms/testingplatform/exitcodes)


##[error]Error: The process 'F:\agent10\_work\_tool\dotnet8\dotnet.exe' failed with exit code 1
Result Attachments will be stored in LogStore
Run Attachments will be stored in LogStore
Failed to parse result files: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at System.Text.StringBuilder.ToString()
   at System.IO.File.ReadAllText(String path, Encoding encoding)
   at Microsoft.TeamFoundation.TestClient.PublishTestResults.TrxResultParser.CreateXmlDocumentFromResultFile(String filePath)
   at Microsoft.TeamFoundation.TestClient.PublishTestResults.TrxResultParser.ParseTestResultFile(TestRunContext runContext, String filePath)
   at Microsoft.TeamFoundation.TestClient.PublishTestResults.TrxResultParser.<>c__DisplayClass1_0.<ParseTestResultFiles>b__0(String file)
   at System.Linq.Enumerable.SelectListIterator`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.ToList()
   at Microsoft.TeamFoundation.TestClient.PublishTestResults.TrxResultParser.ParseTestResultFiles(TestRunContext runContext, IList`1 resultFilePaths)
   at Microsoft.VisualStudio.Services.Agent.Worker.TestResults.Parser.ParseFiles(IExecutionContext executionContext, TestRunContext testRunContext, List`1 testResultsFiles, ITestResultParser testResultParser) in D:\a\_work\1\s\src\Agent.Worker\TestResults\Parser.cs:line 57

Full task logs with system.debug enabled

Details
 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

Just running "dotnet.exe test" step with "Publish test results and code coverage" checked and arguments "--coverage  --coverage-settings "runsettings.runsettings" -c:$(BuildConfiguration)   --no-restore".  Same works fine when switch from MTP v2 to VSTest with equivalent arguments.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions