[launch_pytest] RegisterEventHandler / OnProcessExit not processed correctly.

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

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.

Description

backlog

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!

Dominant language
Python
Stars
156
Forks
200
Avg merge
2d 11h
Merged PRs (30d)
11

Getting set up

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.

More from ros2/launch

All issues in ros2/launch

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.