Skip to content

Improve sansio coverage, add TLS shutdown on handshake failure - #547

Open
vsoulgard wants to merge 5 commits into
boostorg:developfrom
vsoulgard:feature/231-sansio-coverage
Open

vsoulgard wants to merge 5 commits into
boostorg:developfrom
vsoulgard:feature/231-sansio-coverage

Conversation

@vsoulgard

Copy link
Copy Markdown
Contributor

close #443
close #231

@vsoulgard
vsoulgard marked this pull request as draft November 14, 2026 17:24
@codecov

codecov Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.26%. Comparing base (11eab1a) to head (55ff1ed).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #547      +/-   ##
===========================================
+ Coverage    99.19%   99.26%   +0.06%     
===========================================
  Files          146      147       +1     
  Lines         7452     7466      +14     
===========================================
+ Hits          7392     7411      +19     
+ Misses          60       55       -5     
Files with missing lines Coverage Δ
...clude/boost/mysql/impl/internal/sansio/execute.hpp 100.00% <100.00%> (+2.50%) ⬆️
...ude/boost/mysql/impl/internal/sansio/handshake.hpp 100.00% <100.00%> (+0.65%) ⬆️
...t/mysql/impl/internal/sansio/prepare_statement.hpp 100.00% <100.00%> (+2.43%) ⬆️
...ost/mysql/impl/internal/sansio/quit_connection.hpp 100.00% <ø> (ø)
...st/mysql/impl/internal/sansio/reset_connection.hpp 100.00% <ø> (ø)
...t/mysql/impl/internal/sansio/set_character_set.hpp 100.00% <100.00%> (+2.27%) ⬆️
...oost/mysql/impl/internal/sansio/top_level_algo.hpp 100.00% <ø> (+3.22%) ⬆️

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11eab1a...55ff1ed. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vsoulgard
vsoulgard marked this pull request as ready for review November 14, 2026 20:31
Comment thread test/unit/test/sansio/connect.cpp Resolved
Comment thread test/unit/test/sansio/connect.cpp Resolved
@anarthal

Copy link
Copy Markdown
Collaborator

Thanks for this PR - out of the minor fixes I suggested it looks good. While looking into this, I've seen we don't perform the TLS shutdown when something fails in (MySQL's) handshake, after TLS handshake is performed. I don't think it should be solved in this PR, but if you feel motivated, it's something we should address.

@vsoulgard vsoulgard changed the title Improve sansio coverage Improve sansio coverage, add TLS shutdown on handshake failure Nov 18, 2026
@vsoulgard
vsoulgard requested a review from anarthal November 18, 2026 16:57
@vsoulgard

Copy link
Copy Markdown
Contributor Author

Thanks. Moved TLS shutdown to handshake_algo.

return error_code(client_errc::bad_handshake_packet_type);
stored_ec_ = client_errc::bad_handshake_packet_type;
}
if (st.tls_active)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is shutting down TLS only if the error comes from the server. On edge cases, we do generate errors, too (e.g. the authentication plugin can report an error). I'd say that doing something like this, but at resume (rather than resume_impl) may help.

This branch has not been deployed

No deployments
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.

Connect unit tests Coverage: missing tests (sansio)

2 participants