Skip to content

Fix TopicEcho_TEST race condition with Publisher_TEST (backport #761)#763

Open
mergify[bot] wants to merge 1 commit intogz-gui9from
mergify/bp/gz-gui9/pr-761
Open

Fix TopicEcho_TEST race condition with Publisher_TEST (backport #761)#763
mergify[bot] wants to merge 1 commit intogz-gui9from
mergify/bp/gz-gui9/pr-761

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify bot 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.


This is an automatic backport of pull request #761 done by Mergify.

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

Labels

🏛️ ionic Gazebo Ionic

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

2 participants