test(support): add NETWORK_COVERAGE_TIMEOUT_MULTIPLIER for hermetic fixture wait_for#1113
Merged
Merged
Conversation
…ixture Scale every hermetic-fixture wait_for budget by NETWORK_COVERAGE_TIMEOUT_MULTIPLIER so Http2ClientHermeticTransportTest dispatcher cases can complete the SETTINGS handshake under -fprofile-arcs -ftest-coverage instrumentation. PR #1111 diagnosis confirmed all 7 Round-3 dispatcher TEST_F (and ~30 other fixture-based tests) failed at wait_for(settings_exchanged(), 3s): 5.1-5.4s observed under coverage vs 100-300ms in Debug/Release, producing 0pp delta on src/protocols/http2/http2_client.cpp for three rounds (PR #1108, PR #1109). Changes: - tests/support/hermetic_transport_fixture.h: define NETWORK_COVERAGE_TIMEOUT_MULTIPLIER (default 1), apply to wait_for default timeout argument. - tests/support/hermetic_transport_fixture.cpp: scale make_loopback_tcp_pair accept-handler deadline by the multiplier. - tests/support/CMakeLists.txt: define NETWORK_COVERAGE_TIMEOUT_MULTIPLIER=5 on network_test_support PUBLIC when ENABLE_COVERAGE is ON, so all consuming test executables inherit it at the point of header inclusion. No src/ changes. No new TEST_F. Multiplier defaults to 1 outside coverage builds; Debug/Release matrix observable behaviour is unchanged. Closes #1112
Contributor
Coverage Report
Coverage DetailsFull HTML report is available as a build artifact. |
This was referenced May 8, 2026
Merged
Closed
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.
Closes #1112
What
Add coverage-only
NETWORK_COVERAGE_TIMEOUT_MULTIPLIERtotests/support/hermetic_transport_fixture.hsoHttp2ClientHermeticTransportTest(and other hermetic-fixture users) complete the SETTINGS handshake under-fprofile-arcs -ftest-coverage. Round-5 structural fix per PR #1111 diagnosis.Change Type
src/changes; no new TEST_F)Affected Components
tests/support/hermetic_transport_fixture.h— define multiplier (default1); apply towait_fordefault-argument timeout.tests/support/hermetic_transport_fixture.cpp— scalemake_loopback_tcp_pairaccept-handler deadline.tests/support/CMakeLists.txt— defineNETWORK_COVERAGE_TIMEOUT_MULTIPLIER=5PUBLIC onnetwork_test_supportwhenENABLE_COVERAGEis ON.Why
PR #1111 diagnosis (
docs/coverage/http2_client_round-4-diagnosis.md) confirmed all 7 Round-3 dispatcher TEST_F (and ~30 other fixture-based tests) FAILED at thewait_for(... settings_exchanged() ..., 3s)gate: 5.1-5.4s observed under coverage vs 100-300ms in Debug/Release. Three consecutive rounds (PR #1108 Round 2, PR #1109 Round 3) merged green in Debug/Release CI but produced exactly0ppdelta onsrc/protocols/http2/http2_client.cpp(still 18.75% line / 9.91% branch, byte-identical LH/LF/BRH/BRF). Without this structural fix, every future TEST_F added to exercise dispatcher branches will repeat the 0pp pattern.Related Issues
http2_client.cpp)Where
tests/support/hermetic_transport_fixture.hNETWORK_COVERAGE_TIMEOUT_MULTIPLIERmacro (default1); apply insidewait_for(...)default-argument arithmetic (std::chrono::seconds(2) * NETWORK_COVERAGE_TIMEOUT_MULTIPLIER).tests/support/hermetic_transport_fixture.cppmake_loopback_tcp_pairby the multiplier.tests/support/CMakeLists.txttarget_compile_definitions(network_test_support PUBLIC NETWORK_COVERAGE_TIMEOUT_MULTIPLIER=5)whenENABLE_COVERAGEis ON. PUBLIC so test executables linkingnetwork::test_supportinherit the macro at the point of header inclusion.No
src/changes. No new TEST_F.How
Implementation
#ifndef NETWORK_COVERAGE_TIMEOUT_MULTIPLIER ... #define ... 1 ... #endifso non-coverage TUs see the default1.wait_fordefault-argument timeout becomesstd::chrono::seconds(2) * NETWORK_COVERAGE_TIMEOUT_MULTIPLIER— outside coverage that resolves to2s; under coverage it resolves to10s.make_loopback_tcp_pairdeadline scales the same way.NETWORK_COVERAGE_TIMEOUT_MULTIPLIER=5PUBLIC on thenetwork_test_supportstatic lib only whenENABLE_COVERAGEis ON. PUBLIC propagates throughtarget_link_libraries(... PRIVATE network::test_support)so consuming test executables compile fixture-using TUs with the same macro value.wait_for(... settings_exchanged() ..., 3s)call sites intests/unit/*_branch_test.cppconsume the scaled default; explicit-3s call sites are not modified in this PR (per issue scope discipline — the 3s explicit budgets are caller-provided constants that already exceed observed Debug/Release latency, and the issue's primary lever is the default-argument path that the dispatcher TEST_F use).Testing Done
network_test_support(test target only);src/and production targets are not touched.Test Plan for Reviewers
wait_fordefault-argument diff and confirm it scales withNETWORK_COVERAGE_TIMEOUT_MULTIPLIER.src/or production).1, no behaviour change).Acceptance Criteria
NETWORK_COVERAGE_TIMEOUT_MULTIPLIERexists intests/support/hermetic_transport_fixture.h, defaults to1, set to5only whenENABLE_COVERAGEis ON.wait_for(...)budget reachable via the default argument scales with the multiplier;make_loopback_tcp_pairaccept-handler deadline scales likewise.>= +20pp line AND >= +10pp branchonsrc/protocols/http2/http2_client.cppvs pre-merge sha (baseline:18.75% line (108/576),9.91% branch (97/979)from PR test(http2): stabilize coverage and expand dispatcher branches (#1106) #1109 shad5378644). Cannot be validated in PR-time CI — PR-time matrix is Debug/Release only. Verified by the post-merge coverage workflow ondevelop.Http2ClientHermeticTransportTest.ConnectCompletesSettingsExchangeWithMockPeerplus the 7 dispatcher cases) PASS under instrumentation. Verified post-merge by the coverage workflow.Breaking Changes
None. Multiplier defaults to
1outside coverage builds; Debug/Release behaviour is unchanged.Rollback
git revertis sufficient. Test infrastructure only.Risks
>= +20pp / >= +10ppgate, do NOT close issue infra(test): add COVERAGE_TIMEOUT_MULTIPLIER for hermetic_transport_fixture wait_for (Round 5, Part of #1106, #953) #1112; reopen the diagnosis to investigate whether more call sites need the multiplier or whether Option C (friend-injectedprocess_frame) is needed instead.