Skip to content

fix(test): apply NETWORK_COVERAGE_TIMEOUT_MULTIPLIER at explicit wait_for call sites (#1112)#1114

Merged
kcenon merged 1 commit into
developfrom
fix/issue-1112-call-site-multiplier
May 8, 2026
Merged

fix(test): apply NETWORK_COVERAGE_TIMEOUT_MULTIPLIER at explicit wait_for call sites (#1112)#1114
kcenon merged 1 commit into
developfrom
fix/issue-1112-call-site-multiplier

Conversation

@kcenon

@kcenon kcenon commented May 8, 2026

Copy link
Copy Markdown
Owner

What

Apply NETWORK_COVERAGE_TIMEOUT_MULTIPLIER at the 24 explicit wait_for(..., std::chrono::seconds(3)) call sites in tests/unit/http2_client_branch_test.cpp, plus the make_connected_client default request_timeout = std::chrono::milliseconds(2000) parameter. No src/ changes. No new TEST_F. No fixture changes.

Change Type

  • Test infrastructure / call-site fix only

Why

PR #1113 (Round 4) introduced the multiplier to the fixture default-arg path but left the explicit-timeout call sites unscaled. Round-5 diagnosis (latest comment on #1112) confirmed ROOT_CAUSE 3 (Excluded call sites still trapping) with high confidence:

  • tests/support/hermetic_transport_fixture.h header docstring explicitly states: "Callers passing an explicit timeout should multiply by NETWORK_COVERAGE_TIMEOUT_MULTIPLIER themselves at the call site."
  • The 24 dispatcher TEST_F in http2_client_branch_test.cpp all pass an explicit std::chrono::seconds(3) literal -- so the multiplier never applies, and they trap at literal 3s under coverage instrumentation (observed 5.1-5.4s handshake completion in workflow run 25558218320).
  • make_connected_client default request_timeout = std::chrono::milliseconds(2000) is also literal, so the http2_client request timeout fires before tests can observe success under coverage.

Result: PR #1113 merged green in Debug/Release but produced 0pp coverage delta on src/protocols/http2/http2_client.cpp (still 18.75% line / 9.91% branch, byte-identical LH/LF/BRH/BRF pre vs post).

Related Issues

Where

Path Change
tests/unit/http2_client_branch_test.cpp 25 call-site edits (24 seconds(3) + 1 ms(2000) default arg)

Affected call sites (lines pre-edit)

std::chrono::seconds(3) -> std::chrono::seconds(3) * NETWORK_COVERAGE_TIMEOUT_MULTIPLIER at lines:
633, 672, 744, 768, 793, 816, 848, 883, 907, 928, 948, 978, 1013, 1041, 1082, 1283, 1309, 1379, 1412, 1441, 1472, 1502, 1532, 1567 (24 sites).

request_timeout = std::chrono::milliseconds(2000) default arg in make_connected_client at line 722 -> scaled by multiplier (1 site).

The runtime client->set_timeout(std::chrono::milliseconds(2000)) at line 661 is intentionally untouched -- it configures the http2_client itself in a single-test scope and is not a wait budget.

How

Implementation

  • Mechanical text substitution: every literal std::chrono::seconds(3) becomes std::chrono::seconds(3) * NETWORK_COVERAGE_TIMEOUT_MULTIPLIER.
  • The macro is already visible via the existing #include "hermetic_transport_fixture.h" (line 36) which defines it with default value 1 and is overridden to 5 by tests/support/CMakeLists.txt under NETWORK_COVERAGE_BUILD.
  • Off coverage (multiplier=1), expressions evaluate identically; semantics are unchanged.

Testing

  • Debug and Release matrix CI must pass (semantics unchanged off coverage).
  • Acceptance gate is post-merge coverage workflow on develop: line >=+20pp and branch >=+10pp delta on src/protocols/http2/http2_client.cpp versus the pre-merge sha. The PR landing here is necessary but not sufficient; a separate cron-triggered coverage workflow run will verify Round-5 success.

Breaking Changes

None.

Rollback

git revert -- test file only.

Closes #1112

@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Metric Value
Line Coverage 68.9%
Branch Coverage 34.2%
Target 80% lines / 70% branches
Coverage Details

Full HTML report is available as a build artifact.

@kcenon kcenon merged commit dc419e7 into develop May 8, 2026
9 checks passed
@kcenon kcenon deleted the fix/issue-1112-call-site-multiplier branch May 8, 2026 16:15
kcenon added a commit that referenced this pull request May 8, 2026
Closes #1115

Pivot http2_client dispatcher branch tests to friend-injected process_frame
to bypass the SETTINGS-handshake wait_for path. PR #1114 (Round 5 multiplier)
was structurally bounded by the ctest 300 s timeout under coverage build;
direct injection collapses the 15.175 s wall-clock to 0 ms.

- Add http2_client_test_access friend class gated by NETWORK_ENABLE_TEST_INJECTION
- Refactor 7 Server* dispatcher TEST_F to call process_frame directly
- Production header byte-identical when BUILD_TESTS=OFF
- 14 connect-state TEST_F genuinely require connection state, retained on multiplier scaffold

Post-merge verification: Coverage Analysis workflow on develop measures
delta vs PR #1109 baseline (LH/LF=108/576, BRH/BRF=97/979). Acceptance gate
per #1115 is >=+20pp line / >=+10pp branch on http2_client.cpp.

Part of #953 coverage expansion.
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.

1 participant