From 735b8e71ed38be2296ac780cda9db5ac1cd007a1 Mon Sep 17 00:00:00 2001 From: Jaiveer Singh Date: Fri, 31 Jan 2025 02:44:35 +0000 Subject: [PATCH] Improve unit test robustness --- README.md | 2 +- ...aac_ros_nitros_topic_tools_camera_drop_node_mode_0_test.py | 4 ++++ ...aac_ros_nitros_topic_tools_camera_drop_node_mode_1_test.py | 4 ++++ ...aac_ros_nitros_topic_tools_camera_drop_node_mode_2_test.py | 4 ++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2eb8567..ff0b25c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ NVIDIA Isaac Transport for ROS package for hardware-acceleration friendly moveme ## Overview -[Isaac ROS NITROS](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_nitros) contains NVIDIA’s implementation +Isaac ROS NITROS contains NVIDIA’s implementation of type adaptation and negotiation in ROS 2. To learn more about NITROS, see [here](https://nvidia-isaac-ros.github.io/concepts/nitros/index.html). Isaac ROS NITROS is composed of a number of individual packages, each with either a functional or structural purpose: diff --git a/isaac_ros_nitros_topic_tools/test/isaac_ros_nitros_topic_tools_camera_drop_node_mode_0_test.py b/isaac_ros_nitros_topic_tools/test/isaac_ros_nitros_topic_tools_camera_drop_node_mode_0_test.py index 92900f5..120386c 100644 --- a/isaac_ros_nitros_topic_tools/test/isaac_ros_nitros_topic_tools_camera_drop_node_mode_0_test.py +++ b/isaac_ros_nitros_topic_tools/test/isaac_ros_nitros_topic_tools_camera_drop_node_mode_0_test.py @@ -105,6 +105,10 @@ def test_drop_node(self) -> None: # Publish TOTAL_COUNT number of messages counter = 0 + # This test requires deterministic communication between the test node + # and the NitrosCameraDropNode. A 1-second delay ensures the NitrosCameraDropNode + # has fully started, preventing message drops/flaky tests. + time.sleep(1.0) while counter < TOTAL_COUNT: header = self.node.get_clock().now().to_msg() image_msg.header.stamp = header diff --git a/isaac_ros_nitros_topic_tools/test/isaac_ros_nitros_topic_tools_camera_drop_node_mode_1_test.py b/isaac_ros_nitros_topic_tools/test/isaac_ros_nitros_topic_tools_camera_drop_node_mode_1_test.py index 581e7fb..a3c7ea5 100644 --- a/isaac_ros_nitros_topic_tools/test/isaac_ros_nitros_topic_tools_camera_drop_node_mode_1_test.py +++ b/isaac_ros_nitros_topic_tools/test/isaac_ros_nitros_topic_tools_camera_drop_node_mode_1_test.py @@ -119,6 +119,10 @@ def test_drop_node(self) -> None: # Publish TOTAL_COUNT number of messages counter = 0 + # This test requires deterministic communication between the test node + # and the NitrosCameraDropNode. A 1-second delay ensures the NitrosCameraDropNode + # has fully started, preventing message drops/flaky tests. + time.sleep(1.0) while counter < TOTAL_COUNT: header = self.node.get_clock().now().to_msg() image_msg_1.header.stamp = header diff --git a/isaac_ros_nitros_topic_tools/test/isaac_ros_nitros_topic_tools_camera_drop_node_mode_2_test.py b/isaac_ros_nitros_topic_tools/test/isaac_ros_nitros_topic_tools_camera_drop_node_mode_2_test.py index a88ff5a..3c39b31 100644 --- a/isaac_ros_nitros_topic_tools/test/isaac_ros_nitros_topic_tools_camera_drop_node_mode_2_test.py +++ b/isaac_ros_nitros_topic_tools/test/isaac_ros_nitros_topic_tools_camera_drop_node_mode_2_test.py @@ -110,6 +110,10 @@ def test_drop_node(self) -> None: # Publish TOTAL_COUNT number of messages counter = 0 + # This test requires deterministic communication between the test node + # and the NitrosCameraDropNode. A 1-second delay ensures the NitrosCameraDropNode + # has fully started, preventing message drops/flaky tests. + time.sleep(1.0) while counter < TOTAL_COUNT: header = self.node.get_clock().now().to_msg() image_msg.header.stamp = header