Skip to content

gtest: fix XML filename collisions#15912

Closed
ChandruRavi3708 wants to merge 1 commit into
mesonbuild:masterfrom
ChandruRavi3708:fix/gtest-xml-filename-collision
Closed

gtest: fix XML filename collisions#15912
ChandruRavi3708 wants to merge 1 commit into
mesonbuild:masterfrom
ChandruRavi3708:fix/gtest-xml-filename-collision

Conversation

@ChandruRavi3708

Copy link
Copy Markdown

Summary

Fix gtest log filename collisions when multiple tests share the same name across different suites.

Previously, gtest XML log filenames were generated using only the test name. When identical test names existed in multiple suites, they could write to the same output file, causing overwrites, race conditions, and inconsistent results during parallel execution.

This change ensures uniqueness by incorporating the full suite path along with the test name when generating gtest log filenames.

Problem

Given tests such as:

suite_1 / basic_test_1
suite_2 / basic_test_1

both produced the same XML filename:

basic_test_1.xml

This led to:
overwritten test results
intermittent XML parsing errors
non-deterministic failures in parallel runs
Solution

Update gtest log filename generation to include the suite name:

'-'.join(self.test.suite + [self.test.name]) + '.xml'

This guarantees each test instance produces a unique XML output file.

Testing
Reproduced the issue using the scenario described in issue #15757
Ran the test suite locally
Verified that identical test names across different suites generate unique XML files
Verified no collisions during parallel execution
Confirmed backward compatibility for tests without suite names

Fixes
Fixes #15757

@ChandruRavi3708 ChandruRavi3708 requested a review from bonzini as a code owner June 9, 2026 01:37
@eli-schwartz

Copy link
Copy Markdown
Member

Duplicate of #15875

@eli-schwartz eli-schwartz marked this as a duplicate of #15875 Jun 9, 2026
@ChandruRavi3708 ChandruRavi3708 deleted the fix/gtest-xml-filename-collision branch June 9, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gtest log filenames use only test name for uniqueness

2 participants