Skip to content

Fix launch fixture setup hanging before readiness - #1009

Open
Shubham-Padkonde wants to merge 1 commit into
ros2:rollingfrom
Shubham-Padkonde:fix/launch-fixture-early-exit
Open

Shubham-Padkonde wants to merge 1 commit into
ros2:rollingfrom
Shubham-Padkonde:fix/launch-fixture-early-exit

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

Description

When a launch fixture cannot load an included file, launch_pytest keeps waiting for ReadyToTest after launch has failed. This can hang the test runner indefinitely. A conditional group that skips its readiness action has the same problem when the launch becomes idle.

Wake fixture setup on either readiness or launch-service completion, and report a setup error if the service finishes first. Use a plain future: an extra waiting task would itself keep LaunchService._is_idle() false. Existing successful and delayed readiness still allow the tests to run.

Fixes #732 (the original fixture setup failure; does not change handling of individual node exits after readiness).

Is this user-facing behavior change?

A launch service that finishes before readiness now produces launch service stopped before ReadyToTest instead of leaving fixture setup waiting indefinitely. The original launch error is still logged.

Did you use Generative AI?

Yes. OpenAI Codex (GPT-6) assisted with investigation, implementation, regression tests, validation, and this description.

Additional Information

Validated on Linux/WSL, Python 3.12.13 and pytest 8.4.2:

  • Before the fix, both new early-exit subprocess tests hit their 10-second timeout; the delayed-readiness control passed.
  • All 18 launch_pytest functional tests pass after the fix, including the existing example integration tests.
  • Package flake8, PEP257, and copyright checks pass.
  • The existing baseline also emits an unawaited LaunchService.run_async warning. Existing process-tool tests emit event-loop warnings.
  • XML lint could not run because this environment lacks xmllint; no XML files changed. A full ROS installation, other platforms, and tests of other ROS packages were not run.

Signed-off-by: Shubham Padkonde <shubhampadkonde12@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

launch_pytest Test does not terminate if an error occurs in launch fixture

1 participant