ros2 / ros2/launch

[launch_pytest] RegisterEventHandler / OnProcessExit not processed correctly.

Open
#684 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backlog
Dominant language
Python
Stars
155
Forks
182
Avg merge
2d 14h
Merged PRs (30d)
6

Description

Bug report

Required Info:

  • Operating System:
    • Ubuntu 22.04
  • Installation type:
    • Docker
  • Version or commit hash:
    • ros:rolling-ros-core-jammy
  • Client library (if applicable):
    • launch_pytest
Steps to reproduce issue

I have a launch file with some action that starts other nodes when one exits.

on_station_setup_exit = RegisterEventHandler(
    OnProcessExit(
        target_action=station_setup_node,
        on_exit=[
            joint_state_publisher,
        ],
    )
)

I am creating a launch description for test using that launch file.

full_station_launch = IncludeLaunchDescription(
    PythonLaunchDescriptionSource(
        [pylon_pkg_prefix, "/launch/station.launch.py"]
    )
)

I am currently trying to port from launch_testing to launch_pytest. Everything worked fine with the previous package, but the joint_state_publisher never launches with the new setup. Everything runs if I remove the RegisterEventHandler bit from the launch file and add to launch_description directly. Looking at the launch log output, I can see that station_setup_node exits but joint_state_publisher never starts.

Any pointers would be a huge help, Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the launch_pytest setup with the included Python launch description, RegisterEventHandler, and OnProcessExit shown in the report. Trace how the included description processes the event handler, then verify that joint_state_publisher starts after station_setup_node exits; the issue is done when this behavior matches the direct launch-description setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.