-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Hi,
I created a bunch of "unit-tests" for the static executor.
They test the following scenarios:
- add 1 pub node and 1 sub node to the executor and spin
- add 1 pub node to the executor and spin, then add 1 sub node while spinning
- add 1 pub node and 1 node with no entities to the executor and spin, then add 1 sub to the second node while spinning
- add 1 pub node and 1 sub node to the executor and spin, then while spinning remove the sub node from the executor
You can find them here
https://github.com/alsora/ros2-code-examples/blob/master/simple_static_executor/static_executor_test.cpp
These tests are meant to be used with your rclcpp version (nobleo/feature/static_executor), I opened the ticket here since it was not possible in that repo.
To build colcon build --packages-select simple_static_executor
To run ./install/simple_static_executor/lib/simple_static_executor/static_executor_test 2
Where the number at the end denotes the id of the test you want to run (1, 2, 3, 4)
The results are unfortunately not good.
Test 2 throws an exception
[ERROR] [1584978899.809709877] [rclcpp]: Couldn't add guard_condition to wait set: guard_conditions set is full, at /root/ros2_ws/src/ros2/rcl/rcl/src/rcl/wait.c:456
terminate called after throwing an instance of 'std::runtime_error'
what(): Couldn't fill wait set
Aborted (core dumped)
In test 4 the subscription keeps receiving messages after having been removed from the executor
Could you have a look at the test?
Maybe I'm not using the executor as it is supposed to be used.
FYI the standard SingleThreadExecutor allows to pass all the tests successfully.