What
Add a coverage-only wait_for timeout multiplier to tests/support/hermetic_transport_fixture.h so that Http2ClientHermeticTransportTest cases (and other hermetic-fixture users) can complete their 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 the wait_for(... settings_exchanged() ..., 3s) gate (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 consecutive rounds (PR #1108, PR #1109).
Change Type
Affected Components
tests/support/hermetic_transport_fixture.h (introduce multiplier + apply to wait_for default and call sites)
tests/support/hermetic_transport_fixture.cpp (if any wait_for call sites live there)
tests/CMakeLists.txt or cmake/Coverage.cmake (define NETWORK_COVERAGE_TIMEOUT_MULTIPLIER=5 when NETWORK_COVERAGE_BUILD is ON; default 1 otherwise)
Why
Related Issues
Where
| Path |
Role |
tests/support/hermetic_transport_fixture.h |
Define NETWORK_COVERAGE_TIMEOUT_MULTIPLIER macro (default 1); apply inside wait_for(...) default-argument arithmetic (std::chrono::seconds(2) * NETWORK_COVERAGE_TIMEOUT_MULTIPLIER) and at every explicit wait_for(..., 3s) call site within the fixture/helper code. |
tests/support/hermetic_transport_fixture.cpp |
Mirror multiplier at any explicit wait_for(..., Ns) call site (e.g. make_connected_client). |
tests/CMakeLists.txt (or cmake/Coverage.cmake) |
Add target_compile_definitions(... PRIVATE NETWORK_COVERAGE_TIMEOUT_MULTIPLIER=5) when NETWORK_COVERAGE_BUILD is ON; otherwise set to 1 (or omit so the header default 1 applies). |
No src/ changes. No new TEST_F. TEST_F additions are #1106 / #1107 territory and must wait until this fix lands and a measured coverage delta is verified.
How
Technical Approach
- In
tests/support/hermetic_transport_fixture.h, add near the top of the header:
#ifndef NETWORK_COVERAGE_TIMEOUT_MULTIPLIER
#define NETWORK_COVERAGE_TIMEOUT_MULTIPLIER 1
#endif
- Update the
wait_for default-argument timeout to scale with the multiplier:
std::chrono::milliseconds timeout = std::chrono::seconds(2) * NETWORK_COVERAGE_TIMEOUT_MULTIPLIER
- At every explicit
wait_for(..., 3s) (or other literal-second) call site in the fixture and helpers (make_connected_client, etc.), multiply by NETWORK_COVERAGE_TIMEOUT_MULTIPLIER so the budget becomes 3s * 5 = 15s under coverage builds and stays 3s otherwise.
- In the build system, set
NETWORK_COVERAGE_TIMEOUT_MULTIPLIER=5 when NETWORK_COVERAGE_BUILD is ON. Use the same target-scope compile definition mechanism that already gates the existing NETWORK_COVERAGE_BUILD macro so the multiplier is target-private to test binaries.
- Do NOT add or modify any TEST_F in this PR.
Acceptance Criteria
Test Plan for Reviewers
- Inspect the
wait_for call-site diff and confirm every literal-second budget scales with NETWORK_COVERAGE_TIMEOUT_MULTIPLIER.
- Verify the build-system change is scoped to test targets (not
src/).
- After merge, trigger the coverage workflow on develop and check
coverage_filtered.info for the post-merge LH/LF/BRH/BRF on src/protocols/http2/http2_client.cpp against the >= +20pp / >= +10pp gate.
Breaking Changes
None. Multiplier defaults to 1 outside coverage builds; observable behaviour in Debug/Release is unchanged.
Rollback
git revert is sufficient. Test infrastructure only; no production-source or schema changes.
Risks
- The 7 dispatcher TEST_F may add 50+ s combined to the coverage workflow runtime when they actually complete (vs aborting at 5s today). Diagnosis explicitly accepts this trade-off.
- If the post-merge coverage delta does not clear the >= +20pp / >= +10pp gate, do NOT close this issue or claim Round 5 success; reopen the diagnosis to investigate whether more call sites need the multiplier or whether Option C (friend-injected
process_frame) is needed instead.
What
Add a coverage-only
wait_fortimeout multiplier totests/support/hermetic_transport_fixture.hso thatHttp2ClientHermeticTransportTestcases (and other hermetic-fixture users) can complete their SETTINGS handshake under-fprofile-arcs -ftest-coverageinstrumentation. PR #1111 diagnosis 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), producing 0pp delta onsrc/protocols/http2/http2_client.cppfor three consecutive rounds (PR #1108, PR #1109).Change Type
src/changes; no new TEST_F)Affected Components
tests/support/hermetic_transport_fixture.h(introduce multiplier + apply towait_fordefault and call sites)tests/support/hermetic_transport_fixture.cpp(if anywait_forcall sites live there)tests/CMakeLists.txtorcmake/Coverage.cmake(defineNETWORK_COVERAGE_TIMEOUT_MULTIPLIER=5whenNETWORK_COVERAGE_BUILDis ON; default 1 otherwise)Why
http2_client.cpp(still 18.75% line / 9.91% branch, byte-identical LH/LF/BRH/BRF pre and post each round).docs/coverage/http2_client_round-4-diagnosis.md) root-caused this as a fixture-wide handshake timing trap under coverage instrumentation, not a test-quality issue.http2_client.cppwill repeat the 0pp pattern. Parent epic Expand unit test coverage from 40% to 80% #953 (40% -> 80% coverage) cannot progress on its single largest gap contributor while this trap stands.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) and at every explicitwait_for(..., 3s)call site within the fixture/helper code.tests/support/hermetic_transport_fixture.cppwait_for(..., Ns)call site (e.g.make_connected_client).tests/CMakeLists.txt(orcmake/Coverage.cmake)target_compile_definitions(... PRIVATE NETWORK_COVERAGE_TIMEOUT_MULTIPLIER=5)whenNETWORK_COVERAGE_BUILDis ON; otherwise set to1(or omit so the header default1applies).No
src/changes. No new TEST_F. TEST_F additions are #1106 / #1107 territory and must wait until this fix lands and a measured coverage delta is verified.How
Technical Approach
tests/support/hermetic_transport_fixture.h, add near the top of the header:wait_fordefault-argument timeout to scale with the multiplier:wait_for(..., 3s)(or other literal-second) call site in the fixture and helpers (make_connected_client, etc.), multiply byNETWORK_COVERAGE_TIMEOUT_MULTIPLIERso the budget becomes3s * 5 = 15sunder coverage builds and stays3sotherwise.NETWORK_COVERAGE_TIMEOUT_MULTIPLIER=5whenNETWORK_COVERAGE_BUILDis ON. Use the same target-scope compile definition mechanism that already gates the existingNETWORK_COVERAGE_BUILDmacro so the multiplier is target-private to test binaries.Acceptance Criteria
NETWORK_COVERAGE_TIMEOUT_MULTIPLIERexists intests/support/hermetic_transport_fixture.h, defaults to1, set to5only underNETWORK_COVERAGE_BUILD.wait_for(...)call site reachable fromHttp2ClientHermeticTransportTest(default-argument and explicit) scales its timeout by the multiplier.1).src/protocols/http2/http2_client.cppversus the pre-merge sha. Reference baseline:18.75% line (108/576),9.91% branch (97/979)from PR test(http2): stabilize coverage and expand dispatcher branches (#1106) #1109 (sha d537864).Http2ClientHermeticTransportTest.ConnectCompletesSettingsExchangeWithMockPeer) and the 7 Round-3 dispatcher TEST_F now PASS under instrumentation (perRun testsstep stdout).tests/unit/http2_client_branch_test.cppand any other unit-test file).Test Plan for Reviewers
wait_forcall-site diff and confirm every literal-second budget scales withNETWORK_COVERAGE_TIMEOUT_MULTIPLIER.src/).coverage_filtered.infofor the post-mergeLH/LF/BRH/BRFonsrc/protocols/http2/http2_client.cppagainst the >= +20pp / >= +10pp gate.Breaking Changes
None. Multiplier defaults to
1outside coverage builds; observable behaviour in Debug/Release is unchanged.Rollback
git revertis sufficient. Test infrastructure only; no production-source or schema changes.Risks
process_frame) is needed instead.