Skip to content

De-flake servo and hybrid_planning launch fixtures - #3809

Merged
nbbrooks merged 1 commit into
mainfrom
nbbrooks/deflake-launch-fixtures
Aug 3, 2026
Merged

nbbrooks merged 1 commit into
mainfrom
nbbrooks/deflake-launch-fixtures

Conversation

@nbbrooks

@nbbrooks nbbrooks commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Description

Same fix as #3777, applied to the four remaining launch fixtures with the pattern.

Each launches its gtest node on a fixed TimerAction while controller spawners run in parallel. Under load the spawner hasn't finished activating the controller when the timer fires, so the test starts against a topic with no publisher and fails intermittently:

TimerAction(period=N, actions=[<gtest>])

Replaced with a gate on the last spawner exiting — spawner exits 0 only after the controller is active, so the gtest is guaranteed a live publisher:

RegisterEventHandler(OnProcessExit(target_action=<last_spawner>, on_exit=[<gtest>]))

Fixtures changed

file family
moveit_ros/moveit_servo/tests/launch/servo_ros_integration.test.py ServoRosFixture
moveit_ros/moveit_servo/tests/launch/servo_cpp_integration.test.py servo cpp integration
moveit_ros/moveit_servo/tests/launch/servo_utils.test.py servo utils
moveit_ros/hybrid_planning/test/launch/test_basic_integration.test.py hybrid_planning basic

Verified in a Resolute container: servo 4/4 iterations green, servo_utils 3/3, hybrid_planning 3/3. Each previously flaked at roughly the rate the trajectory_cache family did before #3777.

test_basic_integration.test.py additionally needed RegisterEventHandler and OnProcessExit imported — it calls them unqualified, unlike the servo fixtures which use launch.actions.RegisterEventHandler. Without the import the fixture raises NameError at launch.

Why this is worth landing

This family is currently costing signal on unrelated PRs. The rolling-ci + deprecation check and rolling-ci + ccov failures on #3807 were test_get_cartesian_path_request_features_with_move_group and test_motion_plan_request_features_with_move_group — same root cause, different fixture.

Deliberately not changed

These chain TimerActions across ros2_control and several spawners rather than gating on one terminal timer, so picking the right target_action needs a real reproducer of each family's failure mode:

  • moveit_ros/planning/planning_scene_monitor/test/launch/planning_scene_monitor.test.py
  • moveit_ros/tests/launch/move_group_api.test.py

Checklist

  • Required by CI: Code is auto formatted — launch-file only, pre-commit clean
  • Extend the tutorials / documentation — not applicable
  • Document API changes in MIGRATION.md — not applicable, test fixtures only
  • Create tests, which fail without this PR — these are the tests; the change makes existing ones deterministic
  • Include a screenshot if changing a GUI — not applicable

🤖 Generated with Claude Code

@codecov

codecov Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.28%. Comparing base (e017c91) to head (78c7715).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3809      +/-   ##
==========================================
+ Coverage   46.23%   46.28%   +0.05%     
==========================================
  Files         726      726              
  Lines       59509    59505       -4     
  Branches     7623     7624       +1     
==========================================
+ Hits        27509    27535      +26     
+ Misses      31834    31803      -31     
- Partials      166      167       +1     

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

Same fix as #3777, applied to the four remaining fixtures with the pattern.

Each launched its gtest node on a fixed TimerAction while controller
spawners ran in parallel. Under load the spawner has not finished
activating the controller when the timer fires, so the test starts against
a topic with no publisher and fails intermittently:

  TimerAction(period=N, actions=[<gtest>])

Replaced with a gate on the last spawner exiting -- spawner exits 0 only
after the controller is active, so the gtest is guaranteed a live
publisher:

  RegisterEventHandler(OnProcessExit(target_action=<last_spawner>,
                                     on_exit=[<gtest>]))

Fixtures changed:

  moveit_ros/moveit_servo/tests/launch/servo_ros_integration.test.py
  moveit_ros/moveit_servo/tests/launch/servo_cpp_integration.test.py
  moveit_ros/moveit_servo/tests/launch/servo_utils.test.py
  moveit_ros/hybrid_planning/test/launch/test_basic_integration.test.py

Verified locally in the Resolute audit container before this change was
first written: servo 4/4 iterations green, servo_utils 3/3,
hybrid_planning 3/3. Previously each flaked at roughly the same rate as
the trajectory_cache family #3777 addressed.

test_basic_integration.test.py additionally needed RegisterEventHandler and
OnProcessExit imported -- it calls them unqualified, unlike the servo
fixtures which use launch.actions.RegisterEventHandler. Without the import
the fixture raises NameError at launch.

Not changed, because they chain TimerActions across ros2_control and
several spawners rather than gating on one terminal timer -- picking the
correct target_action needs a real reproducer of each family's failure:

  moveit_ros/planning/planning_scene_monitor/test/launch/planning_scene_monitor.test.py
  moveit_ros/tests/launch/move_group_api.test.py

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@nbbrooks
nbbrooks force-pushed the nbbrooks/deflake-launch-fixtures branch from 2dd3993 to 78c7715 Compare August 3, 2026 05:18
@nbbrooks
nbbrooks merged commit 40f3140 into main Aug 3, 2026
12 of 14 checks passed
@nbbrooks
nbbrooks deleted the nbbrooks/deflake-launch-fixtures branch August 3, 2026 06:17
@github-project-automation github-project-automation Bot moved this to ✅ Done in MoveIt Aug 3, 2026
@130s 130s added the backport-jazzy Mergify label that triggers a PR backport to Jazzy label Sep 25, 2026
nbbrooks added a commit that referenced this pull request Oct 22, 2026
Same fix as #3777, applied to the four remaining fixtures with the pattern.

Each launched its gtest node on a fixed TimerAction while controller
spawners ran in parallel. Under load the spawner has not finished
activating the controller when the timer fires, so the test starts against
a topic with no publisher and fails intermittently:

  TimerAction(period=N, actions=[<gtest>])

Replaced with a gate on the last spawner exiting -- spawner exits 0 only
after the controller is active, so the gtest is guaranteed a live
publisher:

  RegisterEventHandler(OnProcessExit(target_action=<last_spawner>,
                                     on_exit=[<gtest>]))

Fixtures changed:

  moveit_ros/moveit_servo/tests/launch/servo_ros_integration.test.py
  moveit_ros/moveit_servo/tests/launch/servo_cpp_integration.test.py
  moveit_ros/moveit_servo/tests/launch/servo_utils.test.py
  moveit_ros/hybrid_planning/test/launch/test_basic_integration.test.py

Verified locally in the Resolute audit container before this change was
first written: servo 4/4 iterations green, servo_utils 3/3,
hybrid_planning 3/3. Previously each flaked at roughly the same rate as
the trajectory_cache family #3777 addressed.

test_basic_integration.test.py additionally needed RegisterEventHandler and
OnProcessExit imported -- it calls them unqualified, unlike the servo
fixtures which use launch.actions.RegisterEventHandler. Without the import
the fixture raises NameError at launch.

Not changed, because they chain TimerActions across ros2_control and
several spawners rather than gating on one terminal timer -- picking the
correct target_action needs a real reproducer of each family's failure:

  moveit_ros/planning/planning_scene_monitor/test/launch/planning_scene_monitor.test.py
  moveit_ros/tests/launch/move_group_api.test.py


(cherry picked from commit 40f3140)

Co-authored-by: Nathan Brooks <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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