Skip to content

DataDrivenTest double-counted in trx logging #15643

@ndk256

Description

@ndk256

When results are logged to to a TRX file, the totals in the ResultSummary tag seem to count anything with a resultType of DataDrivenTest twice. The console summary gives the correct total, so sometimes the TRX file and console output will have different passed/failed/total/etc numbers for the exact same test run.

Maybe these are being double-counted because each DataDrivenTest result has two nested UnitTestResult tags? I also noticed that the "Passed" dialog gets logged twice in console output for these tests, once with the function name and once with the DisplayName from the DataRow attribute.

Reproduced this in a project that had a single test with a DataRow attribute. Results and logs below (converted to .txt, identifying details scrubbed out):
consoleoutput.txt
ExampleTRX_2026-04-07_16_34_16.txt
log.txt
log.host.26-04-07_16-34-15_58568_5.txt

The command for this test run was vstest.console.exe --Logger:trx --Logger:console --Diag:log.text <project path>/Build/UnitTests/net10.0/ExampleProject.UnitTests.dll > consoleoutput.txt.

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