ros2 / ros2/launch

Python 3.10: launch_testing has a warning of "There is no current event loop"

Open
#613 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
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 arm64
  • Installation type:
    • source
  • Version or commit hash:
    • d2935d6fd85636ace62699eec106cd56f5e9c6a4
  • DDS implementation:
    • Fast-RTPS
  • Client library (if applicable):
    • rclpy
Steps to reproduce issue
$ . /opt/ros/humble/setup.bash
$ mkdir -p jsp_ws/src
$ cd jsp_ws
$ git clone https://github.com/ros/joint_state_publisher -b ros2 src/joint_state_publisher
$ colcon build
$ colcon test
Expected behavior

Tests run and succeed without warning

Actual behavior

Tests run, and succeed, but have warnings like:

=============================== warnings summary ===============================
test/test_64_joint_robot.py: 2 warnings
test/test_mimic_chain.py: 2 warnings
test/test_mimic_cycle.py: 2 warnings
test/test_multi_joints.py: 2 warnings
test/test_zero_joints.py: 2 warnings
  Warning: There is no current event loop
Additional information

This seems to be a change in Python 3.10. In particular, I think that calling get_event_loop without a loop running is now an error. See https://github.com/pytest-dev/pytest-asyncio/issues/212 for some explanation of this. We probably need fixes in launch, launch_ros, and osrf_pycommon (at least).

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

Reproduce the warning with the provided joint_state_publisher checkout and colcon test commands. Inspect event-loop handling in launch, launch_ros, and osrf_pycommon, then verify that the affected tests still succeed without the “There is no current event loop” warning.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.