Skip to content

Fix TopicEcho_TEST race condition with Publisher_TEST#761

Merged
iche033 merged 1 commit intogazebosim:mainfrom
taylorhoward92:fix-topic-echo-test-race
Apr 15, 2026
Merged

Fix TopicEcho_TEST race condition with Publisher_TEST#761
iche033 merged 1 commit intogazebosim:mainfrom
taylorhoward92:fix-topic-echo-test-race

Conversation

@taylorhoward92
Copy link
Copy Markdown
Contributor

@taylorhoward92 taylorhoward92 commented Apr 15, 2026

🦟 Bug fix

Summary

Both TopicEcho_TEST and Publisher_TEST use the /echo topic. When ctest runs tests in parallel (e.g. ctest -j$(nproc)), messages from one test leak into the other, causing non-deterministic failures.

This PR uses a unique topic name (/test_topic_echo) in TopicEcho_TEST by calling SetTopic() before OnEcho(true). The Publisher plugin's default topic is /echo (which Publisher_TEST validates), so TopicEcho_TEST is the right one to change.

Checklist

  • Signed all commits for DCO
  • Added a screen capture or video to the PR description that demonstrates the fix (as needed)
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • Updated Bazel files (if adding new files). Created an issue otherwise.
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers
  • Was GenAI used to generate this PR? If so, make sure to add "Generated-by" to your commits. (See this policy for more info.)

Generated-by: Claude Code

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by and Generated-by messages.

Both TopicEcho_TEST and Publisher_TEST use the "/echo" topic. When ctest
runs tests in parallel, messages from one test leak into the other,
causing non-deterministic failures.

Use a unique topic name ("/test_topic_echo") in TopicEcho_TEST to avoid
the collision. The Publisher plugin's default topic is "/echo" (which
Publisher_TEST validates), so TopicEcho_TEST is the right one to change.

Generated-by: Claude <noreply@anthropic.com>
Signed-off-by: Taylor Howard <taylorhoward@me.com>
@taylorhoward92 taylorhoward92 marked this pull request as ready for review April 15, 2026 09:22
@github-project-automation github-project-automation Bot moved this from Inbox to In review in Core development Apr 15, 2026
@iche033 iche033 merged commit 2f53260 into gazebosim:main Apr 15, 2026
9 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in Core development Apr 15, 2026
@iche033
Copy link
Copy Markdown
Contributor

iche033 commented Apr 15, 2026

@Mergifyio backport gz-gui10 gz-gui9 gz-gui8

@mergify
Copy link
Copy Markdown

mergify Bot commented Apr 15, 2026

backport gz-gui10 gz-gui9 gz-gui8

✅ Backports have been created

Details

mergify Bot pushed a commit that referenced this pull request Apr 15, 2026
Both TopicEcho_TEST and Publisher_TEST use the "/echo" topic. When ctest
runs tests in parallel, messages from one test leak into the other,
causing non-deterministic failures.

Use a unique topic name ("/test_topic_echo") in TopicEcho_TEST to avoid
the collision. The Publisher plugin's default topic is "/echo" (which
Publisher_TEST validates), so TopicEcho_TEST is the right one to change.

Generated-by: Claude <noreply@anthropic.com>

Signed-off-by: Taylor Howard <taylorhoward@me.com>
(cherry picked from commit 2f53260)
mergify Bot pushed a commit that referenced this pull request Apr 15, 2026
Both TopicEcho_TEST and Publisher_TEST use the "/echo" topic. When ctest
runs tests in parallel, messages from one test leak into the other,
causing non-deterministic failures.

Use a unique topic name ("/test_topic_echo") in TopicEcho_TEST to avoid
the collision. The Publisher plugin's default topic is "/echo" (which
Publisher_TEST validates), so TopicEcho_TEST is the right one to change.

Generated-by: Claude <noreply@anthropic.com>

Signed-off-by: Taylor Howard <taylorhoward@me.com>
(cherry picked from commit 2f53260)
mergify Bot pushed a commit that referenced this pull request Apr 15, 2026
Both TopicEcho_TEST and Publisher_TEST use the "/echo" topic. When ctest
runs tests in parallel, messages from one test leak into the other,
causing non-deterministic failures.

Use a unique topic name ("/test_topic_echo") in TopicEcho_TEST to avoid
the collision. The Publisher plugin's default topic is "/echo" (which
Publisher_TEST validates), so TopicEcho_TEST is the right one to change.

Generated-by: Claude <noreply@anthropic.com>

Signed-off-by: Taylor Howard <taylorhoward@me.com>
(cherry picked from commit 2f53260)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants