Skip to content

Upstream quality changes from Apex.AI part-2 #1924

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

Merged
merged 23 commits into from
Apr 25, 2025

Conversation

MichaelOrlov
Copy link
Contributor

@MichaelOrlov MichaelOrlov commented Feb 27, 2025

This PR consolidates fixes related to the code quality and stability after backporting Rosbag2 PRs to Apex.AI. PART 2

List of changes:

  1. Fix for record_if_topic_list_service_list_and_all_are_specified
    Details: Flush output from Python print when printing warnings. Some tests rely on the warning output to be in the std::cout. Without flushing, the warnings may not be captured by tests.
  2. Fix for flaky test_play_services
    Details: Increase timeouts for service calls in rosbag2_transport test_play_services tests
  3. Address unused variable warning on the clang16 build
  4. Mark MessageProducer<T> as final to address clang16 warnings "destructor called on non-final 'msg_utils::MessageProducer' that has virtual functions but non-virtual destructor"
  5. Fix linter warnings in the message_definition_encoding.md
  6. Mitigate flakiness in record_all_include_unpublished_false
    Details: Increase timeout when waiting to stop discovery at least to 0.5 sec. The record_all_include_unpublished_false_includes_later_published tends to be flaky due to the insufficient timeout for waiting to stop the discovery thread in the recorder.
  7. Use RESOURCES_PATH from envar in the test_transport.py
    Rationale: Fix to avoid failure with remote test execution and to be consistent with other similar tests.
  8. Reduce runtime for the PlayerTestFixture.playing_respects_delay
  9. Fix for flaky play_respect_messages_timing_after_play_next.
    Details: Take the start timestamp before calling resume for the player.
  10. Add debug info to flaky test_play_cancel
  11. Print warnings instead of errors for not-found type definitions
  12. Adjust test_rosbag2_storage_api.cpp for bounded strings.
    Details: Reduce the size of each std_string_msg to fit in a 256-byte boundary.
  13. Address CPPLint warnings in the rosbag2_storage_sqlite3
  14. Fix CPP_LINT warnings about missing include headers
  15. Address flakiness in test_play_services.
    Details: Increase timeout for expect_messages(..). Also add player_->wait_for_playback_to_start(); in setup_player()
  16. Fix for incorrectly handling exit code in wait_until_completion(..)

@MichaelOrlov MichaelOrlov changed the title Upstream quality changes from Apex.AI part-2 [draft] Upstream quality changes from Apex.AI part-2 Feb 28, 2025
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
- Increase timeout for `expect_messages(..)`
- Also add `player_->wait_for_playback_to_start();` in `setup_player()`

Signed-off-by: Michael Orlov <morlovmr@gmail.com>
@MichaelOrlov MichaelOrlov force-pushed the morlov/upstream-quality-changes-from-apexai-2 branch 2 times, most recently from 0022efc to 14405d4 Compare April 23, 2025 18:44
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
- Reduce size of each std_string_msg to fit in 256 byte boundary

Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
 - Fix to avoid failure with remote test execution and to be consistent
  with oter similar tests.

Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Increase timeout when waiting to stop discovery at least to the 0.5 sec.
The record_all_include_unpublished_false_includes_later_published is
tend to be flaky due to the insufficient timeout for waiting to stop
discovery thread in the recorder.

Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
- Address clang16 warning:
"destructor called on non-final 'msg_utils::MessageProducer<T>' that
has virtual functions but non-virtual destructor".

Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Increase timeouts for service calls in rosbag2_transport
`test_play_services` tests

Signed-off-by: Michael Orlov <morlovmr@gmail.com>
- Flush output from Python print when printing warnings. Some tests rely
on the warning output to be in the std::cout. Without flushing the
warnings may not be captured by tests.

Signed-off-by: Michael Orlov <morlovmr@gmail.com>
@MichaelOrlov MichaelOrlov force-pushed the morlov/upstream-quality-changes-from-apexai-2 branch from 14405d4 to a652fa3 Compare April 23, 2025 20:20
@MichaelOrlov MichaelOrlov marked this pull request as ready for review April 23, 2025 20:40
@MichaelOrlov MichaelOrlov changed the title [draft] Upstream quality changes from Apex.AI part-2 Upstream quality changes from Apex.AI part-2 Apr 23, 2025
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
MichaelOrlov and others added 3 commits April 24, 2025 15:26
Sort includes alphabetically in test_service_utils.cpp

Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Copy link
Member

@christophebedard christophebedard left a comment

Choose a reason for hiding this comment

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

The Rpr job doesn't seem happy

@MichaelOrlov
Copy link
Contributor Author

@ros-pull-request-builder retest this please

@MichaelOrlov
Copy link
Contributor Author

Pulls: #1924
Gist: https://gist.githubusercontent.com/MichaelOrlov/fa4c49a68ce6a7e317d8dd4ddb435b04/raw/0b6dd10403dabed361b5810ba1f3b948e5073b1e/ros2.repos
BUILD args: --packages-above-and-dependencies ros2bag rosbag2_cpp rosbag2_examples_py rosbag2_py rosbag2_performance_benchmarking rosbag2_storage_sqlite3 rosbag2_transport rosbag2_tests
TEST args: --packages-above ros2bag rosbag2_cpp rosbag2_examples_py rosbag2_py rosbag2_performance_benchmarking rosbag2_storage_sqlite3 rosbag2_transport rosbag2_tests
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/15772

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@MichaelOrlov MichaelOrlov merged commit 6f44ee0 into rolling Apr 25, 2025
12 checks passed
@MichaelOrlov MichaelOrlov deleted the morlov/upstream-quality-changes-from-apexai-2 branch April 25, 2025 17:45
@MichaelOrlov
Copy link
Contributor Author

https://github.com/Mergifyio backport kilted jazzy

Copy link

mergify bot commented Apr 25, 2025

backport kilted jazzy

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Apr 25, 2025
* Fix for incorrectly handling exit code in wait_until_completion(..)

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Address flakiness in test_play_services

- Increase timeout for `expect_messages(..)`
- Also add `player_->wait_for_playback_to_start();` in `setup_player()`

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Fix CPP_LINT warnings about missing include headers

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Address CPPLint warnings in the rosbag2_storage_sqlite3

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Adjust test_rosbag2_storage_api.cpp for bounded strings

- Reduce size of each std_string_msg to fit in 256 byte boundary

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Print warnings instead of errors for not found type definitions

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Add debug info to flaky `test_play_cancel` in rosbag2_py

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Fix for flaky play_respect_messages_timing_after_play_next

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Reduce runtime for the `PlayerTestFixture.playing_respects_delay` test

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Address review comment by using `delay_margin(0.5s)`

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Address linter warnings in the test_transport.py

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Use RESOURCES_PATH from envar in test_transport.py

 - Fix to avoid failure with remote test execution and to be consistent
  with oter similar tests.

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Mitigate flakiness in record_all_include_unpublished_false

Increase timeout when waiting to stop discovery at least to the 0.5 sec.
The record_all_include_unpublished_false_includes_later_published is
tend to be flaky due to the insufficient timeout for waiting to stop
discovery thread in the recorder.

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Fix linter errors in the `message_definition_encoding.md`

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Minor changes in rosbag2_examples_py

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Mark MessageProducer<T> as final to address clang16 warnings

- Address clang16 warning:
"destructor called on non-final 'msg_utils::MessageProducer<T>' that
has virtual functions but non-virtual destructor".

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Address unused variable warning on the clang16 build

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Fix for flaky `test_play_services`

Increase timeouts for service calls in rosbag2_transport
`test_play_services` tests

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Fix for record_if_topic_list_service_list_and_all_are_specified

- Flush output from Python print when printing warnings. Some tests rely
on the warning output to be in the std::cout. Without flushing the
warnings may not be captured by tests.

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Sort includes alphabetically in the `info.cpp` file

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Update rosbag2_cpp/test/rosbag2_cpp/test_service_utils.cpp

Sort includes alphabetically in test_service_utils.cpp

Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Sort includes in test_rosbag2_cpp_get_service_info.cpp

Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Sort includes in rosbag2_py/_info.cpp

Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>

---------

Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com>
(cherry picked from commit 6f44ee0)
mergify bot pushed a commit that referenced this pull request Apr 25, 2025
* Fix for incorrectly handling exit code in wait_until_completion(..)

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Address flakiness in test_play_services

- Increase timeout for `expect_messages(..)`
- Also add `player_->wait_for_playback_to_start();` in `setup_player()`

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Fix CPP_LINT warnings about missing include headers

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Address CPPLint warnings in the rosbag2_storage_sqlite3

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Adjust test_rosbag2_storage_api.cpp for bounded strings

- Reduce size of each std_string_msg to fit in 256 byte boundary

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Print warnings instead of errors for not found type definitions

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Add debug info to flaky `test_play_cancel` in rosbag2_py

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Fix for flaky play_respect_messages_timing_after_play_next

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Reduce runtime for the `PlayerTestFixture.playing_respects_delay` test

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Address review comment by using `delay_margin(0.5s)`

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Address linter warnings in the test_transport.py

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Use RESOURCES_PATH from envar in test_transport.py

 - Fix to avoid failure with remote test execution and to be consistent
  with oter similar tests.

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Mitigate flakiness in record_all_include_unpublished_false

Increase timeout when waiting to stop discovery at least to the 0.5 sec.
The record_all_include_unpublished_false_includes_later_published is
tend to be flaky due to the insufficient timeout for waiting to stop
discovery thread in the recorder.

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Fix linter errors in the `message_definition_encoding.md`

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Minor changes in rosbag2_examples_py

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Mark MessageProducer<T> as final to address clang16 warnings

- Address clang16 warning:
"destructor called on non-final 'msg_utils::MessageProducer<T>' that
has virtual functions but non-virtual destructor".

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Address unused variable warning on the clang16 build

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Fix for flaky `test_play_services`

Increase timeouts for service calls in rosbag2_transport
`test_play_services` tests

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Fix for record_if_topic_list_service_list_and_all_are_specified

- Flush output from Python print when printing warnings. Some tests rely
on the warning output to be in the std::cout. Without flushing the
warnings may not be captured by tests.

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Sort includes alphabetically in the `info.cpp` file

Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Update rosbag2_cpp/test/rosbag2_cpp/test_service_utils.cpp

Sort includes alphabetically in test_service_utils.cpp

Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Sort includes in test_rosbag2_cpp_get_service_info.cpp

Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>

* Sort includes in rosbag2_py/_info.cpp

Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com>
Signed-off-by: Michael Orlov <morlovmr@gmail.com>

---------

Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Co-authored-by: Christophe Bedard <bedard.christophe@gmail.com>
(cherry picked from commit 6f44ee0)

# Conflicts:
#	ros2bag/ros2bag/verb/record.py
#	rosbag2_cpp/src/rosbag2_cpp/info.cpp
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.

3 participants