Move network-dependent s_client tests into integration_test, fix getaddrinfo UB - #3407
Open
justsmth wants to merge 2 commits into
Open
Move network-dependent s_client tests into integration_test, fix getaddrinfo UB#3407justsmth wants to merge 2 commits into
justsmth wants to merge 2 commits into
Conversation
Connect() only returned early from a getaddrinfo failure when |quiet| was false. The openssl s_client path passes quiet=true, so a DNS failure fell through to the loop over |result|, which getaddrinfo leaves uninitialized on error, and then to freeaddrinfo() on that same garbage pointer. Reproduced in a container with no external routing: tool_openssl_test --gtest_filter=SClientTest.Connect died with SIGSEGV at transport_common.cc:160, with ret=-3 (EAI_AGAIN) and result=0x7. Because it crashed the process, it also aborted the 500+ remaining tests in that binary. With this change the same run fails cleanly and the rest of the suite completes. The error return is now unconditional; only reporting the error is gated on |quiet|.
Contributor
|
🔒 Security Review — View Report Please review before merging. |
skmcgrail
previously approved these changes
Aug 5, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3407 +/- ##
==========================================
- Coverage 78.20% 78.13% -0.07%
==========================================
Files 695 696 +1
Lines 124220 124220
Branches 17263 17265 +2
==========================================
- Hits 97148 97065 -83
- Misses 26151 26319 +168
+ Partials 921 836 -85 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Five of the seven SClientTest cases connect to amazon.com:443 and fail intermittently in CI when egress is unavailable or rate limited. They now live in tool-openssl/s_client_integration_test.cc, built into the integration_test executable alongside the OCSP responder tests. integration_test is deliberately absent from util/all_tests.json, so the default test run (go run util/all_tests.go, ninja run_tests) never invokes it. Environments without outbound access, such as internal sandbox builds, get a hermetic default suite without needing to opt out of anything. NoConnect and Help do not open a connection, so they stay in tool_openssl_test. The moved tests are renamed to the SClientIntegrationTest suite to match OCSPIntegrationTest and to keep binaries distinguishable in logs.
justsmth
force-pushed
the
skip-remote-connection-tests
branch
from
August 5, 2026 21:07
41c78da to
614a2a1
Compare
Collaborator
Author
|
Per Samuel's recommendation, I instead moved the tests that connect to live endpoints into the "integration_test". |
samuel40791765
approved these changes
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes:
Two commits. No issue number; this came out of chasing intermittent
SClientTestfailures in CI.integration_test-- the 5SClientTestcases that connect toamazon.com:443move totool-openssl/s_client_integration_test.cc, joining the OCSP responder tests.integration_testis deliberately absent fromutil/all_tests.json, so the default test run no longer touches the network.NoConnectandHelpdo not connect, so they stay intool_openssl_test.getaddrinfofailure inConnect-- the early return was gated onquiet, whichopenssl s_clientsets, so a DNS failure fell through into a loop over an uninitializedaddrinfo *and thenfreeaddrinfo()on it.Call-outs:
tool_openssl_testcrashed on its first networked test and aborted the other 500+. It is reachable from the shippedopenssl s_clienton any DNS failure, so it is worth fixing independently of the test move. Happy to split it into its own PR.integration_testnow needs theSClientToollink closure, sossl/CMakeLists.txtreaches intotool-openssl/. Slightly awkward layering; open to a better arrangement.ocsp-external-tests.ymlstill runs on every PR, so these tests can still go red -- just in an isolated job rather than the main matrix. I left the workflow name and job id untouched so a pinned required check does not break.Testing:
Existing tests, plus a container with routing cut (0 routes, no DNS):
util/all_tests.goreports "All unit tests passed!" and never invokesintegration_test. Run explicitly there,integration_testfails without crashing.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.
`