Skip to content

[iron] Fix for failing throws_on_invalid_pragma_in_config_file test on Windows (backport #1742)#1747

Merged
MichaelOrlov merged 1 commit intoironfrom
mergify/bp/iron/pr-1742
Jul 13, 2024
Merged

[iron] Fix for failing throws_on_invalid_pragma_in_config_file test on Windows (backport #1742)#1747
MichaelOrlov merged 1 commit intoironfrom
mergify/bp/iron/pr-1742

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify bot commented Jul 13, 2024

RCA (Root Cause Analysis)

The failure was because the database file was not properly closed after throwing an exception from the SqliteWrapper constructor, and std::filesystem::remove_all(..) failed to delete a temporary folder in the test fixture destructor.

Fixes

  • I added a reset for the prepared SQL statement before throwing the exception.
  • Try to close the database in the constructor if we get an exception after opening the database since the destructor will not be called in this case.

This is an automatic backport of pull request #1742 done by [Mergify](https://mergify.com).

…1742)

- The failure was because database file was not properly closed after
throwing exception from the SqliteWrapper constructor and
std::filesystem::remove_all(..) failed to delete temporary folder in the
test fixture destructor.
- Added reset for prepared sql statement before throwing exception.
- Try to close database in constructor if we got exception after
opening it since destructor will not be called in this case.

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
(cherry picked from commit 055935d)
@mergify mergify bot requested a review from a team as a code owner July 13, 2024 00:09
@mergify mergify bot requested review from emersonknapp and james-rms and removed request for a team July 13, 2024 00:09
@MichaelOrlov MichaelOrlov changed the title Fix for failing throws_on_invalid_pragma_in_config_file test on Windows (backport #1742) [iron] Fix for failing throws_on_invalid_pragma_in_config_file test on Windows (backport #1742) Jul 13, 2024
@MichaelOrlov
Copy link
Copy Markdown
Contributor

Pulls: #1747
Gist: https://gist.githubusercontent.com/MichaelOrlov/8d9dfe394154bc7c94312fdfa11a97fc/raw/e2449862f2d58cc9ebdcf2e74bf2394b3e6bd65f/ros2.repos
BUILD args: --packages-above-and-dependencies rosbag2_storage_sqlite3 rosbag2_tests
TEST args: --packages-above rosbag2_storage_sqlite3 rosbag2_tests
ROS Distro: iron
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/14232

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

@MichaelOrlov MichaelOrlov merged commit 2dbad1d into iron Jul 13, 2024
@MichaelOrlov MichaelOrlov deleted the mergify/bp/iron/pr-1742 branch July 13, 2024 05:56
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.

2 participants