Skip to content

test(udp-server): [#2283] increase udp server package coverage - #2381

Merged
josecelano merged 56 commits into
torrust:developfrom
josecelano:2283-1347-increase-udp-server-package-coverage
Sep 30, 2026
Merged

josecelano merged 56 commits into
torrust:developfrom
josecelano:2283-1347-increase-udp-server-package-coverage

Conversation

@josecelano

Copy link
Copy Markdown
Member

Closes #2283

Part of EPIC #1347.

Summary

Systematic unit-test coverage work for the torrust-tracker-udp-server package. 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.

  • 23 test commits under 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.
  • One production change: a typo fix in the server start/stop error message ("sever" → "server").
  • One Tokio-owned barrier test removed from server/mod.rs (it tested Tokio, not the package).
  • No new real UDP integration tests: per-file review found no case where loopback was clearer than the direct unit contract.
  • Behaviour intentionally left uncovered is documented per file with its owner, mainly lifecycle/shutdown policy owned by Overhaul: Tracker Shutdown #1488.

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: Increase udp-server package coverage #2283 coverage figures.

Unit-Test Coverage Changes

Unit-only (cargo llvm-cov -p torrust-tracker-udp-server --all-features --lib) line coverage, filtered to packages/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

Metric Before After
Lines 5,471 / 5,688 (96.18%) 6,314 / 6,431 (98.18%)
Regions 7,183 / 7,534 (95.34%) 8,267 / 8,519 (97.04%)
Functions 562 / 592 (94.93%) 680 / 696 (97.70%)
Uncovered lines 217 117

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-merged develop PRs (#2351 for #2342, #2354 for #2345), so their deltas are not solely from this issue.

File Before After Δ
error.rs 52 / 62 (83.87%) 92 / 92 (100.00%) +16.13
server/processor.rs † 72 / 85 (84.71%) 180 / 180 (100.00%) +15.29
handlers/error.rs 155 / 178 (87.08%) 218 / 218 (100.00%) +12.92
handlers/mod.rs 184 / 214 (85.98%) 241 / 250 (96.40%) +10.42
server/bound_socket.rs 55 / 65 (84.62%) 77 / 86 (89.53%) +4.91
event.rs 125 / 131 (95.42%) 190 / 190 (100.00%) +4.58
server/launcher.rs † 278 / 290 (95.86%) 463 / 467 (99.14%) +3.28
handlers/announce.rs 781 / 800 (97.63%) 903 / 905 (99.78%) +2.15
testing/environment.rs 168 / 184 (91.30%) 185 / 200 (92.50%) +1.20
statistics/repository.rs 547 / 549 (99.64%) 523 / 523 (100.00%) +0.36
handlers/scrape.rs † 319 / 321 (99.38%) 506 / 508 (99.61%) +0.23
handlers/connect.rs 251 / 251 (100.00%) 212 / 212 (100.00%) 0.00 (duplicate test code removed)
server/states.rs † 72 / 77 (93.51%) 84 / 90 (93.33%) −0.18
server/mod.rs † 176 / 177 (99.44%) 250 / 252 (99.21%) −0.23
statistics/event/handler/request_aborted.rs 56 / 57 (98.25%) 33 / 34 (97.06%) −1.19 (duplicate test removed; same single uncovered line)
statistics/event/handler/request_banned.rs 56 / 57 (98.25%) 33 / 34 (97.06%) −1.19 (duplicate test removed; same single uncovered line)
banning/event/handler.rs 81 / 82 (98.78%) 81 / 82 (98.78%) 0.00
banning/event/listener.rs 147 / 150 (98.00%) 147 / 150 (98.00%) 0.00
container.rs 59 / 59 (100.00%) 59 / 59 (100.00%) 0.00
lib.rs 28 / 29 (96.55%) 28 / 29 (96.55%) 0.00
server/receiver.rs 55 / 56 (98.21%) 55 / 56 (98.21%) 0.00
server/request_buffer.rs 162 / 174 (93.10%) 162 / 174 (93.10%) 0.00
server/spawner.rs 17 / 17 (100.00%) 17 / 17 (100.00%) 0.00
statistics/event/handler/error.rs 131 / 151 (86.75%) 131 / 151 (86.75%) 0.00
statistics/event/handler/mod.rs 19 / 21 (90.48%) 19 / 21 (90.48%) 0.00
statistics/event/handler/request_accepted.rs 162 / 163 (99.39%) 162 / 163 (99.39%) 0.00
statistics/event/handler/request_discarded.rs 33 / 34 (97.06%) 33 / 34 (97.06%) 0.00
statistics/event/handler/request_received.rs 33 / 34 (97.06%) 33 / 34 (97.06%) 0.00
statistics/event/handler/response_sent.rs 122 / 130 (93.85%) 122 / 130 (93.85%) 0.00
statistics/event/listener.rs 164 / 172 (95.35%) 164 / 172 (95.35%) 0.00
statistics/metrics.rs 827 / 834 (99.16%) 827 / 834 (99.16%) 0.00
statistics/mod.rs 52 / 52 (100.00%) 52 / 52 (100.00%) 0.00
statistics/services.rs 32 / 32 (100.00%) 32 / 32 (100.00%) 0.00

Declaration-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

  • Pre-commit gate passed (all 9 steps, including linter all, cargo machete, cargo deny check bans, and doc tests).
  • Pre-push gate passed on the rebased head (nightly format, nightly check, nightly docs, full stable test suite).
  • Package tests: 199 unit tests, 11 integration tests, 1 doc test passed.
  • Mutation sample (cargo-mutants 27.0.0, bounded to handlers::handle_packet): the viable mutation was caught; no survivors. See mutation-evidence.md.
  • Manual verification: built tracker run locally on 127.0.0.1:16969 from an isolated, git-ignored config; the unified tracker_client performed a real UDP announce and scrape successfully. See manual-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.

Copilot AI balanced review requested due to automatic review settings September 30, 2026 08:03
@josecelano josecelano self-assigned this Sep 30, 2026
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.
@josecelano
josecelano force-pushed the 2283-1347-increase-udp-server-package-coverage branch from c898575 to d5cb1c2 Compare September 30, 2026 08:11
@josecelano
josecelano requested a review from da2ce7 September 30, 2026 08:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

An added asynchronous test can hang indefinitely, and completion metadata remains internally inconsistent.

Review effort: Balanced
Findings: 1 Medium severity · 3 Low severity

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.
@josecelano

Copy link
Copy Markdown
Member Author

ACK b0c1fdc

@josecelano
josecelano merged commit 665dde4 into torrust:develop Sep 30, 2026
20 checks passed
josecelano added a commit to josecelano/torrust-tracker that referenced this pull request Sep 30, 2026
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.
josecelano added a commit that referenced this pull request Sep 30, 2026
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
@josecelano
josecelano deleted the 2283-1347-increase-udp-server-package-coverage branch September 30, 2026 13:09

@da2ce7 da2ce7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-46 declares it, and nothing in the tree quoted the old text.
  • server/mod.rs −66 is the deleted mod test_tokio, a test of Tokio's Barrier (plan R1).
  • statistics/repository.rs −73, handlers/connect.rs −47, request_aborted.rs/request_banned.rs −25 each, and handlers/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().await calls at scrape.rs:700 and :723 (loop F5);
  • no new sleep, #[ignore] or serial;
  • no fixed port newly bound: sockets bind port 0, and the 6969 literals are never-bound ServiceBinding values, 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.
  • d5cb1c225 landed (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 --lib and --test integration subsets. No coverage skill exists under .github/skills/.
  • Mutation: cargo-mutants 27.0.0 generated 3 mutants (1 caught, 2 unviable, 0 survivors), and the catching test exists in handlers/mod.rs.
  • The spec at head is consistent: status: in-progress, T1–T8 DONE, 16/16 acceptance boxes checked, AC1–AC16 DONE, and last-updated-utc 08: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_failure or action_required.
  • After the #2384 archive rename, the EPIC rows on develop link to closed/.
  • 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 407fad06d exit 0; worktree unchanged after the run.
  • cargo test -p torrust-tracker-udp-server at 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");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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 Tracker fixture holds udp_server_broadcaster and udp_server_stats_event_sender for the whole test (lines 172-173). If handle_scrape ever stops publishing the accepted event, recv never returns Closed, and the package test run stalls instead of failing.
  • What the fix covered: b0c1fdcfe bounded 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 develop 86392041d: 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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 at docs/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-review is empty.
  • review-comments.json holds four root comments and no replies. Each GraphQL thread has exactly one comment and isResolved: 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 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.rs shows 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.rs 288/298;
  • server/mod.rs 137/138;
  • server/states.rs 72/77;
  • testing/environment.rs 183/198;
  • error.rs 86/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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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" \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

This branch was previously deployed

1 inactive deployment
coverage — b0c1fdcf Deployed Sep 30, 2026 by josecelano via Generate Coverage Report #2370
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.

Overhaul Packages Testing: Increase udp-server package coverage

3 participants