Skip to content

test: cover the option enums, spillover paths, and late-port-message drops - #189

Open
puzza007 wants to merge 2 commits into
masterfrom
coverage-gaps
Open

puzza007 wants to merge 2 commits into
masterfrom
coverage-gaps

Conversation

@puzza007

Copy link
Copy Markdown
Owner

Coverage analysis of the full CT run showed the uncovered source lines that guard real behaviour clustered in four places, and this closes all of them.

check_opts_values validates every option enum value no HTTP-level test exercises -- ntlm/negotiate auth, the http_version and sslversion values, verbose, explicit stream/stream_window defaults, string sslcert/sslkey, reply_to -- plus the check_opts error return, taking katipo_req to full line coverage. Admission picks are random (wpool's fast_rand_uniform is unseedable), so spillover_success and spillover_admission_timeout pin the picked worker with meck on wpool_pool:random_worker to deterministically drive a request through spillover to the second worker, and through the bounded admission call timing out against a suspended candidate. port_late_progress injects fabricated port frames for an unregistered request -- a chunk and a terminal error -- proving both are dropped silently and the worker stays healthy; the real race window (port output in flight while the cancel lands) is too narrow to hit reliably, which is also why the late-terminal branch was previously covered only by timing luck. streaming_cancel_during_flood exercises the same invariant end-to-end under a chunk flood, and pipelining_http1 covers the last accepted pool option value.

Also removes katipo_worker:start_link/1: wpool drives the worker callbacks through wpool_process, so nothing ever called it. Its is_list guard moves to init/1.

The lines still uncovered after this are deliberate: the thirteen no-argument convenience wrappers, two microsecond race windows (await's late-response flush, request timer vs completion), and defensive catch-alls.

🤖 Generated with Claude Code

https://claude.ai/code/session_014cDA7Wx8Pw1xXJ73LnhqKq

@codecov

codecov Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.70%. Comparing base (587e0a5) to head (2bcb667).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #189      +/-   ##
==========================================
+ Coverage   78.37%   80.70%   +2.32%     
==========================================
  Files           9        9              
  Lines        1369     1394      +25     
==========================================
+ Hits         1073     1125      +52     
+ Misses        296      269      -27     
Flag Coverage Δ
c 80.70% <ø> (+2.32%) ⬆️
erlang 80.70% <ø> (+2.32%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

…drops

Coverage analysis of the full CT run showed the uncovered lines that
guard real behaviour clustered in four places, now tested:

- check_opts_values validates every option enum value no HTTP-level test
  exercises (ntlm/negotiate auth, the http_version and sslversion values,
  verbose, explicit stream/stream_window defaults, string sslcert/sslkey,
  reply_to) plus the check_opts error return, taking katipo_req to full
  line coverage.
- spillover_success and spillover_admission_timeout pin the admission
  pick (meck on wpool_pool:random_worker) to deterministically drive a
  request through spillover to the second worker, and through the bounded
  admission call timing out against a suspended candidate.
- port_late_progress injects fabricated port frames for an unregistered
  request -- a chunk and a terminal error -- proving both are dropped
  silently and the worker stays healthy; the real race window is too
  narrow to hit reliably. streaming_cancel_during_flood exercises the
  same invariant end-to-end under a chunk flood.
- pipelining_http1 covers the last accepted pool option value.

Also remove katipo_worker:start_link/1: wpool drives the worker callbacks
through wpool_process, so nothing ever called it. Its is_list guard moves
to init/1.
The 500ms request timer raced admission-to-headers latency: in the
loaded parallel async group the timer could fire before the headers
arrived, delivering katipo_error instead -- which the selective receive
in expect_stream_headers ignored, so the test sat out its full 5s and
failed with an uninformative no_stream_headers. Seen once on the CI
HTTP/3 job.

Widen the budget to 2s (no wall-clock cost: parallel siblings already
wait longer), and teach expect_stream_headers to fail immediately with
the actual error when a terminal message beats the headers, so any
future failure names its cause.
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