Skip to content

De-flake trajectory_cache _with_move_group tests, take 2 - #3859

Merged
nbbrooks merged 2 commits into
mainfrom
nbbrooks/fix-trajectory-cache-move-group-flake
Sep 22, 2026
Merged

nbbrooks merged 2 commits into
mainfrom
nbbrooks/fix-trajectory-cache-move-group-flake

Conversation

@nbbrooks

@nbbrooks nbbrooks commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

[Written by AI]

test_motion_plan_request_features_with_move_group has been the recurring failure in the jazzy-ci + ikfast job (runs 34683703000, 34819993343, 35124906659), while every other matrix entry passes on the same commits.

The test asserts that StartStateJointStateFeatures writes insert metadata. For an is_diff start state that path calls MoveGroupInterface::getCurrentState(), which only waits one second for a complete robot state; when it times out the feature returns UNABLE_TO_AQUIRE_SENSOR_DATA, no metadata is written, and the follow-on queryList assertions fail with "no such column: M_StartStateJointStateFeatures.start_state.joint_state.name_0".

The gating added in #3777 is working: joint_state_broadcaster is activated and publishing before the test binary launches. What remains is subscriber-side discovery of /joint_states taking longer than a second on a loaded runner. The fixture's own spin loop made that worse by busy-waiting at 100% CPU while several of these tests run concurrently under ctest.

So prime the current state monitor once in SetUp() with a 10s timeout, so the short waits inside the cache always find a populated monitor, and block in spin_once() instead of hot-looping on spin_some(). Raise the add_ros_test timeouts to 120s so a genuine /joint_states failure reports the assertion message rather than being killed by the harness.

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

Summary by CodeRabbit

  • Tests
    • Improved reliability of trajectory cache testing by allowing move-group test scenarios more time to initialize and complete.
    • Added bounded waiting for robot state updates, with clearer diagnostics when a complete state is unavailable.
    • Updated test execution behavior to avoid indefinite waiting during fixture setup.

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: d92e5c09-8096-463e-ab7b-1890d06d5da7

📥 Commits

Reviewing files that changed from the base of the PR and between 693b2af and dd7e544.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 3d9953fa-6d19-43f2-80c1-7a6236b543f3

📥 Commits

Reviewing files that changed from the base of the PR and between 561c866 and 693b2af.

📒 Files selected for processing (1)
  • moveit_ros/trajectory_cache/test/fixtures/move_group_fixture.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • moveit_ros/trajectory_cache/test/fixtures/move_group_fixture.cpp

Included review availability: Your plan provides up to 8 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The MoveGroup test fixture now uses bounded waits for robot state and executor processing. Six MoveGroup ROS tests now have 120-second timeouts instead of 30 seconds.

Changes

Trajectory cache test timing

Layer / File(s) Summary
Bounded MoveGroup fixture waits
moveit_ros/trajectory_cache/test/fixtures/move_group_fixture.cpp
The fixture waits up to 10 seconds for a complete robot state and limits each executor spin to 100 ms.
Extended MoveGroup test timeouts
moveit_ros/trajectory_cache/test/CMakeLists.txt
Six MoveGroup test invocations increase their timeout from 30 to 120 seconds.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 693b2

The change makes trajectory-cache tests wait more reliably for robot state and permits longer execution, without changing production behavior. It is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: improving reliability for the trajectory_cache _with_move_group tests. It is concise and specific.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 48.82%. Comparing base (82b575f) to head (dd7e544).

Files with missing lines Patch % Lines
...jectory_cache/test/fixtures/move_group_fixture.cpp 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3859      +/-   ##
==========================================
- Coverage   48.87%   48.82%   -0.05%     
==========================================
  Files         733      733              
  Lines       62604    62607       +3     
  Branches     7612     7612              
==========================================
- Hits        30592    30562      -30     
- Misses      32012    32045      +33     

☔ 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.

nbbrooks and others added 2 commits September 22, 2026 12:49
test_motion_plan_request_features_with_move_group has been the recurring
failure in the jazzy-ci + ikfast job (runs 34683703000, 34819993343,
35124906659), while every other matrix entry passes on the same commits.

The test asserts that StartStateJointStateFeatures writes insert metadata.
For an is_diff start state that path calls MoveGroupInterface::getCurrentState(),
which only waits one second for a complete robot state; when it times out the
feature returns UNABLE_TO_AQUIRE_SENSOR_DATA, no metadata is written, and the
follow-on queryList assertions fail with "no such column:
M_StartStateJointStateFeatures.start_state.joint_state.name_0".

The gating added in #3777 is working: joint_state_broadcaster is activated and
publishing before the test binary launches. What remains is subscriber-side
discovery of /joint_states taking longer than a second on a loaded runner. The
fixture's own spin loop made that worse by busy-waiting at 100% CPU while
several of these tests run concurrently under ctest.

So prime the current state monitor once in SetUp() with a 10s timeout, so the
short waits inside the cache always find a populated monitor, and block in
spin_once() instead of hot-looping on spin_some(). Raise the add_ros_test
timeouts to 120s so a genuine /joint_states failure reports the assertion
message rather than being killed by the harness.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
clang-tidy's readability-identifier-naming requires GlobalConstantCase to be
UPPER_CASE, which is also what the rest of the trajectory_cache package uses.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@nbbrooks
nbbrooks force-pushed the nbbrooks/fix-trajectory-cache-move-group-flake branch from 693b2af to dd7e544 Compare September 22, 2026 16:50
@nbbrooks
nbbrooks merged commit b222baf into main Sep 22, 2026
12 of 13 checks passed
@nbbrooks
nbbrooks deleted the nbbrooks/fix-trajectory-cache-move-group-flake branch September 22, 2026 19:28
@github-project-automation github-project-automation Bot moved this to ✅ Done in MoveIt Sep 22, 2026
RazvanApostuWF pushed a commit to wefabricate/moveit2 that referenced this pull request Sep 24, 2026
* De-flake trajectory_cache _with_move_group tests, take 2

test_motion_plan_request_features_with_move_group has been the recurring
failure in the jazzy-ci + ikfast job (runs 34683703000, 34819993343,
35124906659), while every other matrix entry passes on the same commits.

The test asserts that StartStateJointStateFeatures writes insert metadata.
For an is_diff start state that path calls MoveGroupInterface::getCurrentState(),
which only waits one second for a complete robot state; when it times out the
feature returns UNABLE_TO_AQUIRE_SENSOR_DATA, no metadata is written, and the
follow-on queryList assertions fail with "no such column:
M_StartStateJointStateFeatures.start_state.joint_state.name_0".

The gating added in moveit#3777 is working: joint_state_broadcaster is activated and
publishing before the test binary launches. What remains is subscriber-side
discovery of /joint_states taking longer than a second on a loaded runner. The
fixture's own spin loop made that worse by busy-waiting at 100% CPU while
several of these tests run concurrently under ctest.

So prime the current state monitor once in SetUp() with a 10s timeout, so the
short waits inside the cache always find a populated monitor, and block in
spin_once() instead of hot-looping on spin_some(). Raise the add_ros_test
timeouts to 120s so a genuine /joint_states failure reports the assertion
message rather than being killed by the harness.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Use UPPER_CASE for the new fixture constants

clang-tidy's readability-identifier-naming requires GlobalConstantCase to be
UPPER_CASE, which is also what the rest of the trajectory_cache package uses.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
(cherry picked from commit b222baf)
RazvanApostuWF added a commit to wefabricate/moveit2 that referenced this pull request Sep 24, 2026
* utils: Added check for constrain region position and modified warnings

* Removed COLCON_IGNORE file from trajectory_cache package

* CI: CI now removes the colcon_ignore files on build to prevent compatibility issues

* CI: Keep moveit_setup_simulation ignored and stage COLCON_IGNORE removal

- moveit_setup_simulation is COLCON_IGNOREd upstream (unfinished port), so it stays ignored in CI
- git rm stages the deletions, keeping them out of the clang-tidy patch (git diff)

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Include rviz_common/logging.hpp where RVIZ_COMMON_LOG_* is used (moveit#3861)

* Include rviz_common/logging.hpp where RVIZ_COMMON_LOG_* is used

rolling-ci broke on main between Sep 16 (093360f, green) and Sep 22
(b89c048, red) with a build failure, not a test failure:

  rviz_plugin_render_tools/src/trajectory_visualization.cpp:166:5:
    error: 'RVIZ_COMMON_LOG_WARNING' was not declared in this scope
  1 package failed: moveit_ros_visualization

No MoveIt commit in that window touches visualization. The trigger was the
weekly moveit/moveit2:rolling-ci image rebuild on Sep 19 (run 35463509686),
which moved rviz from 16.0.2-1resolute.20260821 to 16.0.3-1resolute.20260916.
That same scheduled run's source (rolling) image build already hit this error.

The upstream change is ros2/rviz#1798 ("Moved implementation to cpp", merged
2026-07-16), which removed #include "rviz_common/logging.hpp" from
rviz_common/interaction/forwards.hpp. That was the one include path by which
trajectory_visualization.cpp reached the RVIZ_COMMON_LOG_* macros:

  trajectory_visualization.cpp
    -> rviz_default_plugins/robot/robot_link.hpp
      -> rviz_common/interaction/forwards.hpp
        -> rviz_common/logging.hpp          (edge removed by moveit#1798)

Walking the include graph of both release tarballs finds exactly one path at
16.0.2 and none at 16.0.3.

trajectory_visualization.cpp is just the first file the build reaches.
robot_state_display.cpp and interactive_marker_display.cpp have no path to
logging.hpp under 16.0.3 either and would fail as soon as the build gets past
moveit_rviz_plugin_render_tools; planning_scene_display.cpp still reaches it
via transformation_manager.hpp -> pluginlib_factory.hpp. Include the header
explicitly in all four rather than leaving three of them on an accident.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Include rviz_common/frame_manager_iface.hpp where getFrameManager() is used

Second casualty of the same rviz 16.0.3 include cleanup. With the logging.hpp
fix in place the build gets further and then fails on:

  planning_scene_display.cpp:741:30: error: invalid use of incomplete type
    'class rviz_common::FrameManagerIface'

ros2/rviz#1829 ("Cleanup headers") dropped #include "frame_manager_iface.hpp"
from display_context.hpp, so `context_->getFrameManager()->...` now sees only
the forward declaration that display_context.hpp still carries.

robot_state_display.cpp already includes the header directly and is fine.
interactive_marker_display.cpp has the same call and additionally upcasts the
shared_ptr from getTransformer(), so it needs the complete FrameTransformer
type too.

Diffing the reachable-header sets of every file under moveit_ros/visualization
between the 16.0.2 and 16.0.3 trees, five rviz headers stop being reachable:
logging.hpp, logging_handler.hpp, frame_manager_iface.hpp, frame_transformer.hpp
and ros_integration/ros_node_abstraction.hpp. Of those, only logging.hpp (the
previous commit), frame_manager_iface.hpp and frame_transformer.hpp are used by
symbol anywhere in the tree, and all are now included directly.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
(cherry picked from commit 82b575f)

* De-flake trajectory_cache _with_move_group tests, take 2 (moveit#3859)

* De-flake trajectory_cache _with_move_group tests, take 2

test_motion_plan_request_features_with_move_group has been the recurring
failure in the jazzy-ci + ikfast job (runs 34683703000, 34819993343,
35124906659), while every other matrix entry passes on the same commits.

The test asserts that StartStateJointStateFeatures writes insert metadata.
For an is_diff start state that path calls MoveGroupInterface::getCurrentState(),
which only waits one second for a complete robot state; when it times out the
feature returns UNABLE_TO_AQUIRE_SENSOR_DATA, no metadata is written, and the
follow-on queryList assertions fail with "no such column:
M_StartStateJointStateFeatures.start_state.joint_state.name_0".

The gating added in moveit#3777 is working: joint_state_broadcaster is activated and
publishing before the test binary launches. What remains is subscriber-side
discovery of /joint_states taking longer than a second on a loaded runner. The
fixture's own spin loop made that worse by busy-waiting at 100% CPU while
several of these tests run concurrently under ctest.

So prime the current state monitor once in SetUp() with a 10s timeout, so the
short waits inside the cache always find a populated monitor, and block in
spin_once() instead of hot-looping on spin_some(). Raise the add_ros_test
timeouts to 120s so a genuine /joint_states failure reports the assertion
message rather than being killed by the harness.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Use UPPER_CASE for the new fixture constants

clang-tidy's readability-identifier-naming requires GlobalConstantCase to be
UPPER_CASE, which is also what the rest of the trajectory_cache package uses.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
(cherry picked from commit b222baf)

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Co-authored-by: Nathan Brooks <[email protected]>
@130s 130s added the backport-jazzy Mergify label that triggers a PR backport to Jazzy label Sep 25, 2026
130s pushed a commit that referenced this pull request Nov 23, 2026
* De-flake trajectory_cache _with_move_group tests, take 2

test_motion_plan_request_features_with_move_group has been the recurring
failure in the jazzy-ci + ikfast job (runs 34683703000, 34819993343,
35124906659), while every other matrix entry passes on the same commits.

The test asserts that StartStateJointStateFeatures writes insert metadata.
For an is_diff start state that path calls MoveGroupInterface::getCurrentState(),
which only waits one second for a complete robot state; when it times out the
feature returns UNABLE_TO_AQUIRE_SENSOR_DATA, no metadata is written, and the
follow-on queryList assertions fail with "no such column:
M_StartStateJointStateFeatures.start_state.joint_state.name_0".

The gating added in #3777 is working: joint_state_broadcaster is activated and
publishing before the test binary launches. What remains is subscriber-side
discovery of /joint_states taking longer than a second on a loaded runner. The
fixture's own spin loop made that worse by busy-waiting at 100% CPU while
several of these tests run concurrently under ctest.

So prime the current state monitor once in SetUp() with a 10s timeout, so the
short waits inside the cache always find a populated monitor, and block in
spin_once() instead of hot-looping on spin_some(). Raise the add_ros_test
timeouts to 120s so a genuine /joint_states failure reports the assertion
message rather than being killed by the harness.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* Use UPPER_CASE for the new fixture constants

clang-tidy's readability-identifier-naming requires GlobalConstantCase to be
UPPER_CASE, which is also what the rest of the trajectory_cache package uses.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
(cherry picked from commit b222baf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-jazzy Mergify label that triggers a PR backport to Jazzy

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants