Skip to content

mtest: avoid GTest XML filename collisions across suites#15875

Open
ChandruRavi3708 wants to merge 1 commit into
mesonbuild:masterfrom
ChandruRavi3708:master1
Open

mtest: avoid GTest XML filename collisions across suites#15875
ChandruRavi3708 wants to merge 1 commit into
mesonbuild:masterfrom
ChandruRavi3708:master1

Conversation

@ChandruRavi3708

@ChandruRavi3708 ChandruRavi3708 commented Jun 2, 2026

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 the same test name appeared in multiple suites, different test instances could write to the same output file, causing file overwrites and race conditions during parallel execution.

This change makes the generated log filenames unique by incorporating the suite name in addition to the test name.

Problem

Given tests such as:

  • suite_1 / basic_test_1
  • suite_2 / basic_test_1

both tests could generate the same XML filename, resulting in:

  • overwritten test results
  • intermittent XML parsing errors
  • non-deterministic failures when running tests in parallel

Solution

Include the suite name when generating gtest log filenames so that each test instance receives a unique output file.

Testing

  • Reproduced the issue using the example provided in gtest log filenames use only test name for uniqueness #15757.
  • Ran the test suite locally.
  • Verified that tests with identical names in different suites generate distinct XML log files.
  • Verified that parallel test execution no longer produces filename collisions.

Fixes #15757

@ChandruRavi3708 ChandruRavi3708 requested a review from bonzini as a code owner June 2, 2026 05:46
@ChandruRavi3708

Copy link
Copy Markdown
Author

Hi! I’ve submitted a fix for Issue #15757 (GTest XML filename collisions across suites).

The change updates the XML filename generation to avoid collisions when tests with the same name exist in different suites. I’ve verified the reproduction case from the issue and the generated filenames are now unique across suites.

Could you please take a look when you have a chance? Any feedback or suggestions for improvement would be greatly appreciated. Thank you!

@dnicolodi

Copy link
Copy Markdown
Member

Most of the changes in the commit are reformatting of the code. Please do not include those in the submitted patch.

@ChandruRavi3708

Copy link
Copy Markdown
Author

Thanks for the review. I'll clean up the patch and remove the unrelated formatting changes so that the PR contains only the fix for the GTest XML filename collision issue.

@eli-schwartz

Copy link
Copy Markdown
Member

Also the PR description is very complicated in a confusing way -- did you use an LLM to write it?

None of the details are included in the commit message, which could be a sign that you didn't think any of those details are actually useful to read, or could be a problematic omission. Which one is it? :P

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

3 participants