Skip to content

Commit

Permalink
[D] Prevent subscriber tests from hanging forever if no work
Browse files Browse the repository at this point in the history
Backport of ros2#401
Signed-off-by: Dan Rose <[email protected]>
  • Loading branch information
rotu committed Mar 5, 2020
1 parent 0481d6b commit 8e2bd81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test_communication/test/subscriber_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def listener(message_name, namespace):
spin_count = 1
print('subscriber: beginning loop')
while (rclpy.ok() and len(received_messages) != len(expected_msgs)):
rclpy.spin_once(node)
rclpy.spin_once(node, timeout_sec=0)
spin_count += 1
print('spin_count: ' + str(spin_count))
node.destroy_node()
Expand Down

0 comments on commit 8e2bd81

Please sign in to comment.