felixdivo / ros2-easy-test

A Python test framework for ROS2 allowing simple and expressive assertions based on message interactions.
https://ros2-easy-test.readthedocs.io
MIT License
15 stars 5 forks source link

Error "ValueError: list.remove(x): x not in list" in testing on rolling #45

Open felixdivo opened 4 months ago

felixdivo commented 4 months ago

See this log:

____________________ TestSingleNode.test_calling_an_action _____________________
ros2_easy_test/ros2_easy_test/decorators.py:128: in wrapper
    executor.spin_until_future_complete(
/opt/ros/rolling/lib/python3.12/site-packages/rclpy/executors.py:328: in spin_until_future_complete
    self.spin_once_until_future_complete(future, timeout_left)
/opt/ros/rolling/lib/python3.12/site-packages/rclpy/executors.py:907: in spin_once_until_future_complete
    self._spin_once_impl(timeout_sec, future.done)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <rclpy.executors.MultiThreadedExecutor object at 0x7fb80c2f32f0>
timeout_sec = <rclpy.executors.TimeoutObject object at 0x7fb80c41cb90>
wait_condition = <bound method Future.done of <rclpy.task.Task object at 0x7fb80c2f30b0>>

    def _spin_once_impl(
        self,
        timeout_sec: Optional[Union[float, TimeoutObject]] = None,
        wait_condition: Callable[[], bool] = lambda: False
    ) -> None:
        try:
            handler, entity, node = self.wait_for_ready_callbacks(
                timeout_sec, None, wait_condition)
        except ExternalShutdownException:
            pass
        except ShutdownException:
            pass
        except TimeoutException:
            pass
        except ConditionReachedException:
            pass
        else:
            self._executor.submit(handler)
            self._futures.append(handler)
            # make a copy of the list that we iterate over while modifying it
            # (https://stackoverflow.com/q/1207406/3753684)
            for future in self._futures[:]:
                if future.done():
>                   self._futures.remove(future)
E                   ValueError: list.remove(x): x not in list

/opt/ros/rolling/lib/python3.12/site-packages/rclpy/executors.py:895: ValueError
----------------------------- Captured stderr call -----------------------------
[INFO] [1718747826.149957309] [minimal_action_server]: Accepting goal request
[INFO] [1718747826.156829616] [minimal_action_server]: Executing goal...
[INFO] [1718747826.257690692] [minimal_action_server]: Publishing feedback: array('i', [0, 1, 1])
[INFO] [1718747826.268627448] [minimal_action_server]: Publishing feedback: array('i', [0, 1, 1, 2])
[INFO] [1718747826.279537183] [minimal_action_server]: Publishing feedback: array('i', [0, 1, 1, 2, 3])
[INFO] [1718747826.292523641] [minimal_action_server]: Returning result: array('i', [0, 1, 1, 2, 3])
[INFO] [1718747826.298843446] [minimal_action_server]: Accepting goal request
felixdivo commented 4 months ago

Is this connected to https://github.com/ros2/rclpy/pull/1129?