Skip to content

De-flake trajectory_cache _with_move_group tests#3777

Open
nbbrooks wants to merge 2 commits into
moveit:mainfrom
nbbrooks:nbbrooks/fix-with-move-group-flake
Open

De-flake trajectory_cache _with_move_group tests#3777
nbbrooks wants to merge 2 commits into
moveit:mainfrom
nbbrooks:nbbrooks/fix-with-move-group-flake

Conversation

@nbbrooks

Copy link
Copy Markdown
Collaborator

The gtest_with_move_group.py fixture launched the test binary on a fixed TimerAction(period=3.0). On slow CI runs the joint_state_broadcaster had not activated by t=3s, so /joint_states was not yet publishing and the test failed at MoveGroupInterface::getCurrentState() with "Failed to fetch current robot state". This flaked across Noble, Resolute, jazzy, and kilted for the _with_move_group test family.

Gate the test binary launch on joint_state_broadcaster activation instead: spawn the broadcaster as its own ExecuteProcess and start the gtest node from an OnProcessExit handler. The spawner exits 0 only after the controller is loaded, configured, and activated, guaranteeing /joint_states is publishing before the test runs. This removes the wall-clock race entirely.

Description

Please explain the changes you made, including a reference to the related issue if applicable

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference
  • Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • Include a screenshot if changing a GUI
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

The gtest_with_move_group.py fixture launched the test binary on a fixed
TimerAction(period=3.0). On slow CI runs the joint_state_broadcaster had
not activated by t=3s, so /joint_states was not yet publishing and the
test failed at MoveGroupInterface::getCurrentState() with "Failed to
fetch current robot state". This flaked across Noble, Resolute, jazzy,
and kilted for the _with_move_group test family.

Gate the test binary launch on joint_state_broadcaster activation
instead: spawn the broadcaster as its own ExecuteProcess and start the
gtest node from an OnProcessExit handler. The spawner exits 0 only after
the controller is loaded, configured, and activated, guaranteeing
/joint_states is publishing before the test runs. This removes the
wall-clock race entirely.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.29%. Comparing base (4a766fd) to head (3e9e400).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3777      +/-   ##
==========================================
+ Coverage   46.23%   46.29%   +0.06%     
==========================================
  Files         726      726              
  Lines       59512    59508       -4     
  Branches     7622     7623       +1     
==========================================
+ Hits        27509    27541      +32     
+ Misses      31836    31800      -36     
  Partials      167      167              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant