Repository navigation
test(udp-server): [#2283] increase udp server package coverage - #2381
josecelano merged 56 commits into
Conversation
Reopen T4 of torrust#2283 as IN_PROGRESS: the T1 inventory rows are hypotheses, not terminal decisions, so every Rust source file in packages/udp-server/src must be processed through its own file test plan. - Add an explicit Per-File Workflow: create the plan lazily per file, review and refactor the current tests, classify uncovered lines into unit vs integration, record the resulting coverage, with maintainer approval gates and a one-commit-per-file policy. - Reset the 37-file ledger to PENDING/IN_PROGRESS/DONE states in processing order (error.rs DONE, 36 PENDING). - Reframe coverage-evidence.md rows as T1 hypotheses and add a per-file results table. - Point the test-refactor-plans README at the issue as the single source of the workflow and mark error-tests.md as predating the new plan layout. Related to torrust#2283, torrust#1347
Row 29 of the torrust#2283 source-file ledger. The existing focused metric-routing tests remain sufficient; peer-client representation and repository-error logging retain separate ownership.
Row 30 of the torrust#2283 source-file ledger. The existing focused metric-routing test remains sufficient; repository counter-write failure logging retains separate ownership.
Row 31 of the torrust#2283 source-file ledger. The existing focused metric-routing tests remain sufficient; repository counter-write failure logging retains separate ownership.
Row 32 of the torrust#2283 source-file ledger. The existing focused metric-routing test remains sufficient; repository counter-write failure logging retains separate ownership.
Row 33 of the torrust#2283 source-file ledger. The retained focused metric-routing test remains sufficient; repository counter-write failure logging retains separate ownership.
Row 34 of the torrust#2283 source-file ledger. The retained focused metric-routing test remains sufficient; repository counter-write failure logging retains separate ownership.
Row 35 of the torrust#2283 source-file ledger. The existing focused response metric tests remain sufficient; repository failure handling retains separate ownership.
Row 36 of the torrust#2283 source-file ledger. The declaration-only module has no independent runtime contract; testing environment behavior is reviewed separately.
Row 37 of the torrust#2283 source-file ledger adds direct tests for strict and disabled connection ID validation policy mapping. Lifecycle orchestration remains owned by torrust#1488.
Complete the torrust#2283 per-file workflow for all 37 UDP server source files and record that no plan selected a further integration increment.
Document the bounded torrust#2283 packet-dispatch mutation sample: one viable mutant was caught, two were unviable, and none survived.
Restore three omitted torrust#2283 per-file coverage outcomes and normalize the completed processor plan status before final measurement reconciliation.
Record final aggregate, unit-only, and integration-only torrust#2283 coverage and reconcile the parent EPIC tracking tables.
Record final automatic and manual verification, acceptance review, and maintainer approval for Issue torrust#2283.
The statistics event dispatcher plan recorded 21/21 lines and 50/52 regions. The final unit-only and aggregate reports both show 19/21 lines and 41/52 regions. The no-change decision is unaffected.
c898575 to
d5cb1c2
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
An added asynchronous test can hang indefinitely, and completion metadata remains internally inconsistent.
Review effort: Balanced
Findings: 1
Open (4)
What changed in this PR
Expands maintainable unit-test coverage for the UDP server package while documenting per-file decisions and verification evidence.
Changes:
- Adds focused tests for routing, events, socket binding, validation policies, launcher admission, and statistics.
- Refactors or removes duplicate and dependency-owned tests.
- Records coverage, mutation, and manual verification results.
| File | Description |
|---|---|
docs/issues/open/1347-overhaul-packages-testing/EPIC.md |
Updates final UDP coverage figures. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/ISSUE.md |
Records the implementation and acceptance review. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/coverage-evidence.md |
Documents before/after coverage. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/manual-verification-evidence.md |
Records real UDP verification. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/mutation-evidence.md |
Records bounded mutation testing. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/README.md |
Indexes all per-file plans. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/banning-event-handler-tests.md |
Records banning-handler test decision. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/banning-event-listener-tests.md |
Records banning-listener test decision. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/banning-event-mod-tests.md |
Records module test decision. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/banning-mod-tests.md |
Records module test decision. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/container-tests.md |
Records container test decision. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/error-tests.md |
Plans error-adapter coverage. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/event-tests.md |
Plans event classification coverage. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/handlers-announce-tests.md |
Plans announce-handler tests. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/handlers-connect-tests.md |
Plans connect-test refactoring. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/handlers-error-tests.md |
Plans error-routing tests. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/handlers-mod-tests.md |
Plans dispatch coverage. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/handlers-scrape-tests.md |
Plans scrape-handler tests. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/lib-tests.md |
Records library test decision. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/server-bound-socket-tests.md |
Plans socket-binding tests. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/server-launcher-tests.md |
Plans launcher admission tests. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/server-mod-tests.md |
Plans server test cleanup. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/server-processor-tests.md |
Plans response-event tests. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/server-receiver-tests.md |
Records receiver test decision. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/server-request-buffer-tests.md |
Records buffer test decision. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/server-spawner-tests.md |
Records spawner test decision. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/server-states-tests.md |
Records state test decision. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/statistics-event-handler-error-tests.md |
Plans statistics error tests. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/statistics-event-handler-mod-tests.md |
Records module test decision. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/statistics-event-handler-request-aborted-tests.md |
Plans aborted-request cleanup. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/statistics-event-handler-request-accepted-tests.md |
Plans accepted-request tests. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/statistics-event-handler-request-banned-tests.md |
Plans banned-request cleanup. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/statistics-event-handler-request-discarded-tests.md |
Records discarded-request decision. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/statistics-event-handler-request-received-tests.md |
Plans received-request tests. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/statistics-event-handler-response-sent-tests.md |
Plans response-sent tests. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/statistics-event-listener-tests.md |
Records listener test decision. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/statistics-event-mod-tests.md |
Records module test decision. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/statistics-metrics-tests.md |
Records metrics test decision. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/statistics-mod-tests.md |
Records statistics module decision. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/statistics-repository-tests.md |
Plans repository snapshot tests. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/statistics-services-tests.md |
Plans aggregate metrics tests. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/testing-environment-tests.md |
Plans validation-policy tests. |
docs/issues/open/2283-1347-increase-udp-server-package-coverage/test-refactor-plans/testing-mod-tests.md |
Records testing-module decision. |
packages/udp-server/src/error.rs |
Tests error adapters and corrects a message. |
packages/udp-server/src/event.rs |
Tests event classification contracts. |
packages/udp-server/src/handlers/announce.rs |
Expands announce routing coverage. |
packages/udp-server/src/handlers/connect.rs |
Deduplicates connect tests. |
packages/udp-server/src/handlers/error.rs |
Expands error-response coverage. |
packages/udp-server/src/handlers/mod.rs |
Tests packet dispatch and routing. |
packages/udp-server/src/handlers/scrape.rs |
Expands scrape behavior coverage. |
packages/udp-server/src/server/bound_socket.rs |
Tests binding and IPv6 behavior. |
packages/udp-server/src/server/launcher.rs |
Tests launcher admission decisions. |
packages/udp-server/src/server/mod.rs |
Removes a Tokio-owned barrier test. |
packages/udp-server/src/server/processor.rs |
Tests response event publication. |
packages/udp-server/src/statistics/event/handler/error.rs |
Refactors statistics error tests. |
packages/udp-server/src/statistics/event/handler/request_aborted.rs |
Removes duplicate test code. |
packages/udp-server/src/statistics/event/handler/request_accepted.rs |
Clarifies accepted-request tests. |
packages/udp-server/src/statistics/event/handler/request_banned.rs |
Removes duplicate test code. |
packages/udp-server/src/statistics/event/handler/request_received.rs |
Clarifies received-request tests. |
packages/udp-server/src/statistics/event/handler/response_sent.rs |
Expands response metric coverage. |
packages/udp-server/src/statistics/repository.rs |
Tests initialized metric snapshots. |
packages/udp-server/src/statistics/services.rs |
Tests aggregate metrics retrieval. |
packages/udp-server/src/testing/environment.rs |
Tests validation-policy mapping. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Mark the completed Issue torrust#2283 workflow metadata and bound the scrape handler's event assertions so missing events fail instead of hanging the test.
|
ACK b0c1fdc |
Issue torrust#2283 was closed by the merge of PR torrust#2381. Move its spec folder to docs/issues/closed/, mark it done, update related-artifact paths, and mark the torrust#1347 EPIC subissue row DONE with links to the archived folder.
f8e2c3b docs(issues): link #2283 manual verification to its spec (Jose Celano) 176672f chore(issues): archive closed issue #2283 spec (Jose Celano) Pull request description: Related to #2283 Part of EPIC #1347. Archives the spec for issue #2283 (closed on GitHub by the merge of PR #2381) from `docs/issues/open/` to `docs/issues/closed/`. - Verified issue #2283 is `CLOSED` (completed) on GitHub; it was closed by merge commit `665dde461`. - Moved `docs/issues/open/2283-1347-increase-udp-server-package-coverage/` to `docs/issues/closed/` with `git mv`. - Updated `ISSUE.md` frontmatter (`status: done`, `spec-path`, `last-updated-utc`), checked the archive workflow checkpoint, and added a progress log entry. - Updated the `related-artifacts` path in all 37 file test plans. - Updated the #1347 EPIC: subissue row 7 is `DONE` with the closed path, and the two coverage-table links point to the archived folder. - Deliberately retained one historical reference to the old path: the `ISSUE.md` checkpoint recording that the draft was moved to `docs/issues/open/`. - Pre-commit (including Markdown frontmatter and lychee link checks) and pre-push gates passed. ACKs for top commit: josecelano: ACK f8e2c3b Tree-SHA512: fe2679f4dcf64e21e0dcffa80cc5676f9fa0a8d4bae69b7ddfd81e9cdd16f3cb0b8bfeae06e6b3d5a0ab2b2f4598335bde94f56d24d00811d75b6d43f73938b0
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at b0c1fdcfe0640c4ed2b999e70ee88684107d43d4 (round 1, post-merge). Recomputed from the bytes at this head.
Label: POST_MERGE_FINDINGS — this PR merged at 2026-09-30T09:12:58Z as 665dde461 before this review was written; nothing below asks for remediation, and process-pr-review § "Reviews Submitted After Merge" governs any follow-up.
This PR ships no audit record, so Copilot's own IDs F1–F4 (review 5363510967) are the record IDs, and new loop findings start at loop F5.
The PR: 56 commits on base 407fad06d (24 test(udp-server), 31 docs(issues), 1 fix(udp-server), no merges). It changes 63 files (+5022/−808): 20 source files under packages/udp-server/src/, 37 file test plans plus their index, the #2283 spec, three evidence files, and two EPIC #1347 rows.
Production delta. Each file's diff was split against its #[cfg(test)] ranges at base and at head. 19 of the 20 source files change only inside #[cfg(test)] mod tests.
- The one production line is
server/mod.rs:41: the#[error]text changes from "sever" to "server" (a23e8325b).server-mod-tests.md:44-46declares it, and nothing in the tree quoted the old text. server/mod.rs−66 is the deletedmod test_tokio, a test of Tokio'sBarrier(plan R1).statistics/repository.rs−73,handlers/connect.rs−47,request_aborted.rs/request_banned.rs−25 each, andhandlers/scrape.rs+331/−299 all fall inside test modules.testing/environment.rs+30 is inside its own#[cfg(test)] mod tests.
Record F1 and test hygiene. The flagged receives (scrape.rs:377-383) now sit inside one tokio::time::timeout(EVENT_PUBLICATION_TIMEOUT, …) (1 s), whose expect names the deadline. A sweep of every added test line found:
- two unbounded
recv().awaitcalls atscrape.rs:700and:723(loop F5); - no new
sleep,#[ignore]orserial; - no fixed port newly bound: sockets bind port 0, and the
6969literals are never-boundServiceBindingvalues, so no EPIC #2392 subissue applies.
Plans vs tree. 37 source files ↔ 37 plans (target-file) ↔ 37 index rows, with no orphans either way. 15 plans were sampled: every changed file plus scrape, launcher, announce and event. Every test name a plan cites as current exists at head; the missing names are pre-refactor names the plans record as replaced.
Evidence.
- Package totals recompute: 5,471/5,688 (96.18%) → 6,314/6,431 (98.18%). The EPIC deltas recompute: +2.00/+1.70/+2.77 pp and +0.72/+0.98/+0.92 pp.
d5cb1c225landed (19/21 lines and 41/52 regions in both the evidence and the plan).- The per-file "after" column does not reconcile with the final totals (loop F7).
- The commands use the scope of
generate_coverage_pr.yaml:97(-p <pkg> --all-features), with--liband--test integrationsubsets. No coverage skill exists under.github/skills/. - Mutation:
cargo-mutants 27.0.0generated 3 mutants (1 caught, 2 unviable, 0 survivors), and the catching test exists inhandlers/mod.rs. - The spec at head is consistent:
status: in-progress, T1–T8 DONE, 16/16 acceptance boxes checked, AC1–AC16 DONE, andlast-updated-utc08:37 is after the last log entry (07:49).
Copilot threads (all have isResolved: true and no reply):
| Record | Claim | Fix commit | Landed |
|---|---|---|---|
| F1 Major | unbounded scrape receives | test(udp-server): bound scrape event assertions |
flagged site only (loop F5) |
| F2 Major | frontmatter planned, related-pr null |
same | yes: in-progress, 2381, 08:37 |
| F3 Minor | DONE rows vs unchecked checklist | same | yes: 16/16 checked |
| F4 Minor | index in-progress |
same | yes: status: done |
Findings (post-merge; the live column is checked at develop = 86392041d):
| ID | Severity | Live | Recomputation |
|---|---|---|---|
| loop F5 | Major | yes | scrape.rs:700 and :723 call recv().await with no bound (added in 940630c45). The fixture keeps the sender alive, so a missing event hangs the suite. |
| loop F6 | Minor | yes | No docs/pr-reviews/pr-2381-review/PR-REVIEW.md exists at head or on develop, and all four threads were resolved without a reply. |
| loop F7 | Minor | yes | The per-file "after" column sums to 5,856/5,976, against the final 6,314/6,431. |
| loop F8 | Nit | yes | The spec Progress Log mixes appended and prepended entries, and the 07:03 entry sits above the 07:26 one. |
| loop F9 | Nit | yes | The F2–F4 documentation fixes ride in the test(udp-server) commit for F1. |
| loop F10 | Suggestion | yes | Manual scenario V1 depends on a config file that is not recorded. |
Checked, no finding
- All 56 subjects are Conventional Commits.
[#2283]is required only in PR titles (AGENTS.md:381), and the title carries it. - Author time ≤ committer time on every commit, and committer times never decrease.
- No attribution trailer, and no banned token in the 63 changed files.
- CI evidence shows no
startup_failureoraction_required. - After the #2384 archive rename, the EPIC rows on
developlink toclosed/. - The PR body's "Package Totals" equal
coverage-evidence.md. Its per-file table sums to the final totals, but those numbers are not in the tree (loop F7).
Checks
- Loop gate on the head worktree: pre-commit-profile gate (
pre-commit.sh --format=json) passed, exit 0, 41 s;clippy-allow-reasons --base-ref 407fad06dexit 0; worktree unchanged after the run. cargo test -p torrust-tracker-udp-serverat this head: 199 unit, 11 integration and 1 doc test passed, 0 failed (31 s). A passing run does not exercise the missing-event path behind loop F5; the two awaits hang only when an expected event is not published.- CI is not graded post-merge.
| .unwrap(); | ||
| } | ||
| // Assert | ||
| let event = receiver.recv().await.expect("accepted scrape event should be published"); |
There was a problem hiding this comment.
[Major][F5] Two scrape event tests still await receiver.recv() with no bound
loop F5 (same defect class as record F1). Lines 700 and 723 are it_should_publish_an_accepted_scrape_event_for_an_ipv4_client and ..._ipv6_client. Both were added by 940630c45 test(udp-server): clarify scrape handler scenarios, and both still call receiver.recv().await with no bound.
- Why it can hang: the local
Trackerfixture holdsudp_server_broadcasterandudp_server_stats_event_senderfor the whole test (lines 172-173). Ifhandle_scrapeever stops publishing the accepted event,recvnever returnsClosed, and the package test run stalls instead of failing. - What the fix covered:
b0c1fdcfebounded only the cookie-error test (lines 377-383,EVENT_PUBLICATION_TIMEOUT= 1 s). Its message says it bounds "the scrape handler's event assertions so missing events fail instead of hanging the test", which is false for these two. The severity follows record F1's Major for the identical pattern. - Live on
develop86392041d: yes, at the same lines; fix(udp-server): [#2370] own and drain UDP request processors on shutdown #2382 did not touch this file.
This ruling comes from reading the code only; the orchestrator adds its package-test result at posting. One related site is outside this PR's added lines: the unbounded helper at handlers/error.rs:260 predates 407fad06d.
| doc-type: issue | ||
| issue-type: task | ||
| status: planned | ||
| status: in-progress |
There was a problem hiding this comment.
[Minor][F6] Copilot's four findings have no audit record and no thread replies
loop F6. The rules at head:
process-pr-review/SKILL.md:19-20: "The PR author owns one tracked audit record atdocs/pr-reviews/pr-<PR_NUMBER>-review/PR-REVIEW.md."- Step 7 (line 85): "Reply before resolving."
What the bytes show:
- The PR's 63 files include nothing under
docs/pr-reviews/pr-2381-review/. git log --first-parent b0c1fdcfe..86392041d -- docs/pr-reviews/pr-2381-reviewis empty.review-comments.jsonholds four root comments and no replies. Each GraphQL thread has exactly one comment andisResolved: true.
The fixes themselves landed. Because the feedback was neither replied to nor audited when the PR merged, line 109-110 applies: "Feedback submitted before merge but not yet replied to, resolved, or audited when the pull request merged follows the same workflow". Line 130-132 then gives the route: "When the merged PR has no audit, the follow-up branch creates docs/pr-reviews/pr-<PR_NUMBER>-review/PR-REVIEW.md".
The missing file has no diff line, so this comment is anchored on the nearest changed line of the F2 fix (the spec status line). Merged-tree-wrong test: not met by any shipped line; this is an artifact the head's own rule requires. Live on develop: yes.
| | `handlers/mod.rs` | 184 / 214 (85.98%) | 241 / 250 (96.40%) | 0 | 2 | No; remaining fixture-only and generated mock entries are not package-owned production decisions | | ||
| | `handlers/connect.rs` | 251 / 251 (100.00%) | 212 / 212 (100.00%) | 3 | 0 | No; R1 removes duplicate test code while retaining all direct adapter contracts | | ||
| | `handlers/announce.rs` | 781 / 800 (97.63%) | 903 / 905 (99.78%) | 2 | 2 | No; direct adapter contracts cover error routing and address-family response conversion, while the handler has no socket Act | | ||
| | `handlers/scrape.rs` | 319 / 321 (99.38%) | 356 / 357 (99.72%) | 3 | 1 | No; direct error-routing coverage and strict test extraction cover the handler, while it has no socket Act | |
There was a problem hiding this comment.
[Minor][F7] The per-file results do not reconcile with the final coverage measurement
loop F7. In "Per-File Results", the before column sums to the baseline 5,471 / 5,688, but the after column sums to 5,856 / 5,976. This file's "Final Coverage Measurement" unit-only row (line 81) is 6,314 / 6,431.
Six rows hold completion-time snapshots:
handlers/scrape.rsshows 356/357 here, but 506/508 in its own plan's Results (handlers-scrape-tests.md:64), after F1–F5 added tests this row does not count;server/launcher.rs288/298;server/mod.rs137/138;server/states.rs72/77;testing/environment.rs183/198;error.rs86/86.
The PR body's final per-file table (506/508, 463/467, 250/252, 84/90, 185/200, 92/92) sums exactly to 6,314 / 6,431, but it is not in the tree. error.rs also drifts with no † and no commit touching it after 5f80f4a9d.
Merged-tree-wrong test: met. The checked criterion "Reconciliation confirms module records, coverage evidence, acceptance verification, and EPIC tracking are aligned before final verification" and row AC10 are false at head for these rows. Live on develop: yes; the archived docs/issues/closed/2283-…/coverage-evidence.md is a pure rename. The loop does not recompute coverage figures; this finding is about internal consistency only.
| and scrape, recorded in [manual-verification-evidence.md](manual-verification-evidence.md). | ||
| The acceptance review is complete; final reviewer validation remains pending. | ||
|
|
||
| - 2026-09-30 07:03 UTC - GitHub Copilot - Began T7 reconciliation. Confirmed 37 `DONE` ledger |
There was a problem hiding this comment.
[Nit][F8] The spec Progress Log is neither appended nor in order
loop F8. docs/templates/ISSUE.md:152: "Append one line per meaningful update."
- Lines 379–506 run oldest-first, from 2026-09-21 to 2026-09-29 17:23.
- The 14 later entries (2026-09-29 18:09 to 2026-09-30 07:49) sit above them at lines 320–375, newest-first.
- Inside that block, this 07:03 entry comes before the 07:26 entry at line 334.
Live on develop: yes; the archive commit prepended its 09:20 entry the same way.
| doc-type: test-refactor-plan-guidance | ||
| issue: 2283 | ||
| package: torrust-tracker-udp-server | ||
| status: done |
There was a problem hiding this comment.
[Nit][F9] Three documentation fixes ride in the test(udp-server) commit for record F1
loop F9. b0c1fdcfe test(udp-server): bound scrape event assertions also carries the F2 frontmatter fix, the F3 acceptance checkboxes, and this F4 index status. As a result, F2–F4 have no commit subject of their own to cite as a resolution reference.
process-pr-review/SKILL.md:82-84: "Make each independent fix in its own [...] Conventional Commit after focused validation. Cite the unique commit subject, not a branch SHA".
Live: yes (merged history).
| database under `.tmp/`. | ||
|
|
||
| ```text | ||
| TORRUST_TRACKER_CONFIG_TOML_PATH="$PWD/.tmp/2283-manual-runtime.toml" \ |
There was a problem hiding this comment.
[Suggestion][F10] Manual scenario V1 cannot be re-run from this record
loop F10. V1 starts target/debug/torrust-tracker with .tmp/2283-manual-runtime.toml. That file is git-ignored and its contents are not recorded; the record only says "binding UDP to 127.0.0.1:16969 with an isolated SQLite database". No build step is listed, and V2 depends on V1's process.
Recording the TOML and the build command would make the evidence reproducible. Live on develop: yes; the archive added frontmatter only.


Closes #2283
Part of EPIC #1347.
Summary
Systematic unit-test coverage work for the
torrust-tracker-udp-serverpackage. Every one of the 37 source files was processed through its own file test plan (review/refactor existing tests, add focused unit tests where a package-owned contract exists, consider real UDP integration only where it is clearer), with maintainer approval of each plan and completed file.packages/udp-server/src/: new focused unit contracts (error adapters, event classification, handler dispatch, announce/scrape/error routing, bound socket, launcher admission, processor response events, repository snapshots, validation-policy mapping) plus refactors that clarify or deduplicate existing tests.server/mod.rs(it tested Tokio, not the package).Files and Packages Touched
packages/udp-server/src/— 20 Rust files (tests, plus the one-line error-message fix).docs/issues/open/2283-1347-increase-udp-server-package-coverage/— issue spec, 37 file test plans, coverage, mutation, and manual-verification evidence.docs/issues/open/1347-overhaul-packages-testing/EPIC.md— final Overhaul Packages Testing: Increaseudp-serverpackage coverage #2283 coverage figures.Unit-Test Coverage Changes
Unit-only (
cargo llvm-cov -p torrust-tracker-udp-server --all-features --lib) line coverage, filtered topackages/udp-server/src/. Baseline:cfb93157(before any #2283 change). Final: implementation head, 2026-09-30 (cargo-llvm-cov 0.6.16, Rust 1.98.1).Package Totals
Aggregate: 97.86% → 98.58% lines. Integration-only: 76.11% → 75.90% lines (real UDP loopback tests unchanged; the denominator grew).
Per-File Line Coverage
Denominators include in-file
#[cfg(test)]code, so adding or removing tests changes them. Files marked † also changed through already-mergeddevelopPRs (#2351 for #2342, #2354 for #2345), so their deltas are not solely from this issue.error.rsserver/processor.rs†handlers/error.rshandlers/mod.rsserver/bound_socket.rsevent.rsserver/launcher.rs†handlers/announce.rstesting/environment.rsstatistics/repository.rshandlers/scrape.rs†handlers/connect.rsserver/states.rs†server/mod.rs†statistics/event/handler/request_aborted.rsstatistics/event/handler/request_banned.rsbanning/event/handler.rsbanning/event/listener.rscontainer.rslib.rsserver/receiver.rsserver/request_buffer.rsserver/spawner.rsstatistics/event/handler/error.rsstatistics/event/handler/mod.rsstatistics/event/handler/request_accepted.rsstatistics/event/handler/request_discarded.rsstatistics/event/handler/request_received.rsstatistics/event/handler/response_sent.rsstatistics/event/listener.rsstatistics/metrics.rsstatistics/mod.rsstatistics/services.rsDeclaration-only modules with no executable lines:
banning/mod.rs,banning/event/mod.rs,statistics/event/mod.rs,testing/mod.rs.Remaining uncovered lines are mostly lifecycle, shutdown, or task-management paths owned by #1488. The rest need OS-level socket fault injection, are logging-only failure branches, or are owned by collaborator crates. Per-file reasons are in
coverage-evidence.md.Validation
linter all,cargo machete,cargo deny check bans, and doc tests).cargo-mutants 27.0.0, bounded tohandlers::handle_packet): the viable mutation was caught; no survivors. Seemutation-evidence.md.127.0.0.1:16969from an isolated, git-ignored config; the unifiedtracker_clientperformed a real UDP announce and scrape successfully. Seemanual-verification-evidence.md. No local-only patches were used.After merge, the issue spec will be moved to
docs/issues/closed/in a follow-up archive PR.