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

Added optimization for copying arrays of simple types from python to C using buffer protocol (backport #129) #146

Merged
merged 1 commit into from
Dec 10, 2021

Conversation

hexonxons
Copy link

Backport #129 to foxy

Related to #135

…C using buffer protocol (ros2#129)

* Added optimization for copying arrays of simple types from python to C

Signed-off-by: ksuszka <[email protected]>

* Apply suggestions from code review

Co-authored-by: Chris Lalancette <[email protected]>
Signed-off-by: Krzysztof Suszka <[email protected]>

* Remove setting error message twice

Signed-off-by: Krzysztof Suszka <[email protected]>

Co-authored-by: Chris Lalancette <[email protected]>
Signed-off-by: Aleksandr Rozhdestvenskii <[email protected]>
@hexonxons hexonxons force-pushed the foxy_copying_array_optimization branch from d7f90fe to 3606053 Compare October 18, 2021 11:35
@hexonxons
Copy link
Author

@clalancette @sloretz Hello
Is there any chance of this being merged and released to foxy along with messages packages?

@karl-schulz
Copy link

I want to add that we used this fix multiple months with foxy without issues on multiple machines. I think it would be good to have it in there for the large foxy userbase.

@sloretz
Copy link
Contributor

sloretz commented Nov 23, 2021

CI

  • Repos: https://gist.githubusercontent.com/sloretz/0ceeab3a1c8560ca5224fd213f672834/raw/345910333b79c1566f0bc5eb2cf99c2cb18f40e4/ros2.repos
  • build: --packages-above-and-dependencies rosidl_generator_py
  • test: --packages-above rosidl_generator_py

Jobs

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Copy link
Contributor

@sloretz sloretz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with green CI

@aprotyas
Copy link
Member

aprotyas commented Dec 2, 2021

The test failures look unrelated, but kicking off CI again:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@aprotyas
Copy link
Member

aprotyas commented Dec 3, 2021

Looks like the failing sros2 tests have been ticketed in ros2/sros2#251.

@sloretz
Copy link
Contributor

sloretz commented Dec 10, 2021

I'm not sure about some of the test failures on the Windows CI, so here's two more runs

  • Rerun Windows: Build Status
  • Foxy unchanged on Windows for comparison Build Status

@sloretz
Copy link
Contributor

sloretz commented Dec 10, 2021

Only Windows test failure in the rerun that's not in the pure-Foxy CI is:

https://ci.ros2.org/job/ci_windows/16014/testReport/junit/ros2doctor.test/test_cli/test_cli/

Taking a closer look now

================================== FAILURES ===================================
___________________________ launch tests: test_cli ____________________________

==================================================================================================
FAIL: TestROS2DoctorCLI.test_hello_single_host
--------------------------------------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\ci\ws\src\ros2\ros2cli\ros2doctor\test\test_cli.py", line 68, in test_hello_single_host
    self.assertEqual(summary._pub, expected_summary._pub)
AssertionError: 0 != 1
---------------------------- Captured stdout call -----------------------------
[INFO] [launch]: All log files can be found below C:\Users\ContainerAdministrator\.ros\log\2021-12-10-21-32-37-740051-8abff966aab6-16164
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [daemon-stop-3]: process started with pid [28488]
[INFO] [daemon-stop-3]: process has finished cleanly [pid 28488]
---------------------------- Captured stderr call -----------------------------
test_hello_single_host (test_cli.TestROS2DoctorCLI)
Run HelloVerb for one emit period on a single host. ... FAIL

======================================================================
FAIL: test_hello_single_host (test_cli.TestROS2DoctorCLI)
Run HelloVerb for one emit period on a single host.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\ci\ws\src\ros2\ros2cli\ros2doctor\test\test_cli.py", line 68, in test_hello_single_host
    self.assertEqual(summary._pub, expected_summary._pub)
AssertionError: 0 != 1

----------------------------------------------------------------------
Ran 1 test in 0.203s

FAILED (failures=1)

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
---------------------------- Captured stdout call -----------------------------
[INFO] [launch]: All log files can be found below C:\Users\ContainerAdministrator\.ros\log\2021-12-10-21-32-37-740051-8abff966aab6-16164
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [daemon-stop-4]: process started with pid [52532]
[INFO] [daemon-stop-4]: process has finished cleanly [pid 52532]
---------------------------- Captured stderr call -----------------------------
test_hello_single_host (test_cli.TestROS2DoctorCLI)
Run HelloVerb for one emit period on a single host. ... FAIL

======================================================================
FAIL: test_hello_single_host (test_cli.TestROS2DoctorCLI)
Run HelloVerb for one emit period on a single host.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\ci\ws\src\ros2\ros2cli\ros2doctor\test\test_cli.py", line 68, in test_hello_single_host
    self.assertEqual(summary._pub, expected_summary._pub)
AssertionError: 0 != 1

----------------------------------------------------------------------
Ran 1 test in 0.141s

FAILED (failures=1)

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
---------------------------- Captured stdout call -----------------------------
[INFO] [launch]: All log files can be found below C:\Users\ContainerAdministrator\.ros\log\2021-12-10-21-32-37-740051-8abff966aab6-16164
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [daemon-stop-5]: process started with pid [52128]
[INFO] [daemon-stop-5]: process has finished cleanly [pid 52128]
---------------------------- Captured stderr call -----------------------------
test_hello_single_host (test_cli.TestROS2DoctorCLI)
Run HelloVerb for one emit period on a single host. ... FAIL

======================================================================
FAIL: test_hello_single_host (test_cli.TestROS2DoctorCLI)
Run HelloVerb for one emit period on a single host.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\ci\ws\src\ros2\ros2cli\ros2doctor\test\test_cli.py", line 68, in test_hello_single_host
    self.assertEqual(summary._pub, expected_summary._pub)
AssertionError: 0 != 1

----------------------------------------------------------------------
Ran 1 test in 0.152s

FAILED (failures=1)

@sloretz
Copy link
Contributor

sloretz commented Dec 10, 2021

Looks like the ros2doctor test is known flaky, and was fixed in ros2/ros2cli#521 but not backported to Foxy

@sloretz
Copy link
Contributor

sloretz commented Dec 10, 2021

CI LGTM Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants