Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flaky test tf2_test.py:test_nominal_case #259

Open
sloretz opened this issue Mar 14, 2023 · 1 comment
Open

Flaky test tf2_test.py:test_nominal_case #259

sloretz opened this issue Mar 14, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@sloretz
Copy link
Collaborator

sloretz commented Mar 14, 2023

Unexpected test failure of tf2_test.py in #258. The test passed after re-running the job.

https://github.com/RobotLocomotion/drake-ros/actions/runs/4411951236/jobs/7730944385

  12: Test command: /usr/bin/python3.10 "-u" "/opt/ros/humble/share/ament_cmake_test/cmake/run_test.py" "/__w/drake-ros/drake-ros/ros_ws/build/drake_ros/test_results/drake_ros/tf2_test_py.xml" "--package-name" "drake_ros" "--command" "/usr/bin/python3.10" "/__w/drake-ros/drake-ros/ros_ws/src/rx7djvfvei/drake-ros/drake_ros/drake_ros/test/tf2_test.py" "--junit-xml=/__w/drake-ros/drake-ros/ros_ws/build/drake_ros/test_results/drake_ros/tf2_test_py.xml" "--junit-prefix=drake_ros"
  12: Test timeout computed to be: 60
  12: -- run_test.py: invoking following command in '/__w/drake-ros/drake-ros/ros_ws/build/drake_ros/py':
  12:  - /usr/bin/python3.10 /__w/drake-ros/drake-ros/ros_ws/src/rx7djvfvei/drake-ros/drake_ros/drake_ros/test/tf2_test.py --junit-xml=/__w/drake-ros/drake-ros/ros_ws/build/drake_ros/test_results/drake_ros/tf2_test_py.xml --junit-prefix=drake_ros
  12: ============================= test session starts ==============================
  12: platform linux -- Python 3.10.6, pytest-7.2.2, pluggy-1.0.0
  12: rootdir: /__w/drake-ros/drake-ros/ros_ws
  12: plugins: ament-flake8-0.12.5, ament-xmllint-0.12.5, ament-pep257-0.12.5, ament-lint-0.12.5, launch-testing-1.0.4, launch-testing-ros-0.19.4, ament-copyright-0.12.5, rerunfailures-11.1.2, mock-3.10.0, repeat-0.9.1, cov-4.0.0, colcon-core-0.6.1
  12: collected 1 item
  12: 
  12: ../../../src/rx7djvfvei/drake-ros/drake_ros/drake_ros/test/tf2_test.py F [100%]
  12: 
  12: =================================== FAILURES ===================================
  12: ______________________________ test_nominal_case _______________________________
  12: 
  12:     def test_nominal_case():
  12:         drake_ros.core.init()
  12:     
  12:         builder = DiagramBuilder()
  12:     
  12:         sys_ros_interface = builder.AddSystem(
  12:             RosInterfaceSystem('test_tf_broadcaster_py'))
  12:     
  12:         scene_graph = builder.AddSystem(SceneGraph())
  12:         source_id = scene_graph.RegisterSource('test_source')
  12:         odom_frame = scene_graph.RegisterFrame(
  12:             source_id, GeometryFrame('odom'))
  12:         base_link_frame = scene_graph.RegisterFrame(
  12:             source_id, odom_frame, GeometryFrame('base_link'))
  12:     
  12:         X_WO = RigidTransform(
  12:             R=RotationMatrix.Identity(),
  12:             p=np.array([1., 1., 0.]))
  12:         X_OB = RigidTransform(
  12:             rpy=RollPitchYaw(0., 0., math.pi / 2.),
  12:             p=np.array([1., 1., 0.]))
  12:     
  12:         pose_vector = FramePoseVector()
  12:         pose_vector.set_value(odom_frame, X_WO)
  12:         pose_vector.set_value(base_link_frame, X_OB)
  12:     
  12:         pose_vector_source = builder.AddSystem(
  12:             ConstantValueSource(AbstractValue.Make(pose_vector)))
  12:     
  12:         builder.Connect(
  12:             pose_vector_source.get_output_port(),
  12:             scene_graph.get_source_pose_port(source_id))
  12:     
  12:         scene_tf_broadcaster = builder.AddSystem(
  12:             SceneTfBroadcasterSystem(
  12:                 sys_ros_interface.get_ros_interface(),
  12:                 params=SceneTfBroadcasterParams(
  12:                     publish_triggers={TriggerType.kForced}
  12:                 )
  12:             )
  12:         )
  12:     
  12:         builder.Connect(
  12:             scene_graph.get_query_output_port(),
  12:             scene_tf_broadcaster.get_graph_query_input_port())
  12:     
  12:         diagram = builder.Build()
  12:         context = diagram.CreateDefaultContext()
  12:     
  12:         rclpy.init()
  12:         node = rclpy.create_node('tf_listener')
  12:     
  12:         buffer_ = tf2_ros.Buffer()
  12:         listener = tf2_ros.TransformListener(buffer_, node, spin_thread=False)  # noqa
  12:     
  12:         time = rclpy.time.Time(seconds=13.)
  12:         stamp = time.to_msg()
  12:     
  12:         context.SetTime(time.nanoseconds / 1e9)
  12:         diagram.ForcedPublish(context)
  12:     
  12:         future = buffer_.wait_for_transform_async('world', 'odom', time)
  12:         rclpy.spin_until_future_complete(node, future, timeout_sec=2)
  12:     
  12: >       assert future.done()
  12: E       assert False
  12: E        +  where False = <bound method Future.done of <rclpy.task.Future object at 0x7fc26b119840>>()
  12: E        +    where <bound method Future.done of <rclpy.task.Future object at 0x7fc26b119840>> = <rclpy.task.Future object at 0x7fc26b119840>.done
  12: 
  12: ../../../src/rx7djvfvei/drake-ros/drake_ros/drake_ros/test/tf2_test.py:94: AssertionError
  12: - generated xml file: /__w/drake-ros/drake-ros/ros_ws/build/drake_ros/test_results/drake_ros/tf2_test_py.xml -
  12: =========================== short test summary info ============================
  12: FAILED ../../../src/rx7djvfvei/drake-ros/drake_ros/drake_ros/test/tf2_test.py::test_nominal_case - assert False
  12:  +  where False = <bound method Future.done of <rclpy.task.Future object at 0x7fc26b119840>>()
  12:  +    where <bound method Future.done of <rclpy.task.Future object at 0x7fc26b119840>> = <rclpy.task.Future object at 0x7fc26b119840>.done
  12: ============================== 1 failed in 2.16s ===============================
  12: -- run_test.py: return code 1
  12: -- run_test.py: verify result file '/__w/drake-ros/drake-ros/ros_ws/build/drake_ros/test_results/drake_ros/tf2_test_py.xml'
  12/14 Test #12: tf2_test_py ......................***Failed    3.55 sec
@sloretz sloretz added the bug Something isn't working label Mar 14, 2023
@sloretz
Copy link
Collaborator Author

sloretz commented Mar 16, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant