ros2 / ros2/launch

[launch_testing]: Tests without a unittest to run concurrently with the processes under test throw an exception

Open
#380 6 comments 0 reactions 1 assignee View on GitHub

@clalancette is already working on this.

Since Feb 20, 2020.

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

Description

Bug report

I've been debugging https://github.com/ros2/rcutils/issues/204 . The test that causes the problem is at https://github.com/ros2/rcutils/blob/e31371df45afdfac545752777cd61a3a64769ee2/test/test_logging_output_format.py . In that test, you can see that there is a post_shutdown_test, but no test to run concurrently with the processes[1]. When running this test, a stack trace is printed:

[INFO] [launch]: All log files can be found below /home/ubuntu/.ros/log/2020-02-14-17-44-05-848290-ros2-bionic-1149925
[INFO] [launch]: Default logging verbosity is set to INFO

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
Task exception was never retrieved
future: <Task finished coro=<LaunchService._process_one_event() done, defined at /home/ubuntu/ros2_ws/install/launch/lib/python3.6/site-packages/launch/launch_service.py:293> exception=RuntimeError('Signal event received before subprocess transport available.',)>
Traceback (most recent call last):
  File "/home/ubuntu/ros2_ws/install/launch/lib/python3.6/site-packages/launch/launch_service.py", line 295, in _process_one_event
    await self.__process_event(next_event)
  File "/home/ubuntu/ros2_ws/install/launch/lib/python3.6/site-packages/launch/launch_service.py", line 315, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/home/ubuntu/ros2_ws/install/launch/lib/python3.6/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
    sub_entities = entity.visit(context)
  File "/home/ubuntu/ros2_ws/install/launch/lib/python3.6/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/home/ubuntu/ros2_ws/install/launch/lib/python3.6/site-packages/launch/actions/opaque_function.py", line 75, in execute
    return self.__function(context, *self.__args, **self.__kwargs)
  File "/home/ubuntu/ros2_ws/install/launch/lib/python3.6/site-packages/launch/actions/execute_process.py", line 385, in __on_signal_process_event
    raise RuntimeError('Signal event received before subprocess transport available.')
RuntimeError: Signal event received before subprocess transport available.

I'll also note that this doesn't cause the test to fail, it's just a pretty ugly and worrying side-effect.

From my untrained eye, it kind of looks like an empty, rogue unittest process is being launched, but since the launch framework doesn't know about it, the exiting of this process causes it to be upset. It's possible to work around this by adding in a test that runs concurrently with the processes under test, but it would be a much nicer user experience to not have to do that.

[1] As a side note, it's hard to refer to these testcases that run in parallel with the processes under test. Maybe we should add another annotation for them.

Required Info:

  • Operating System:
    • Ubuntu 18.04
  • Installation type:
    • Source
  • Version or commit hash:
    • b99eb3811b80fe9c685151543b5dbb690a52674b
  • DDS implementation:
    • Fast-RTPS
  • Client library (if applicable):
    • rcutils
Steps to reproduce issue
colcon test --packages-select rcutils
Expected behavior

test_logging_output_format.py completes without errors

Actual behavior

Stack trace above is printed.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.