Skip to content

refactor(fast_io): split io_uring/registered_buffers/tests.rs by concern (LoC followup)#4320

Merged
oferchen merged 1 commit into
masterfrom
refactor/registered-buffers-tests-split
May 17, 2026
Merged

refactor(fast_io): split io_uring/registered_buffers/tests.rs by concern (LoC followup)#4320
oferchen merged 1 commit into
masterfrom
refactor/registered-buffers-tests-split

Conversation

@oferchen
Copy link
Copy Markdown
Owner

Summary

Follow-up to #4310. The post-decomposition registered_buffers/tests.rs was 882 lines, over the 650-line cap enforced by tools/enforce_limits.sh. Split into a tests/ directory grouped by concern, each file well under the cap.

File LoC Concern
tests/mod.rs 39 Shared try_ring / try_group helpers, submodule decls
tests/registry.rs 113 Page size, validation guards, slot allocator
tests/submit.rs 179 submit_read_fixed_batch / submit_write_fixed_batch
tests/stats.rs 141 Acquire/miss counters, miss_rate math, snapshots
tests/status.rs 49 try_new_with_status outcome reporting
tests/drop_contract.rs 309 Drop semantics + constrained-env coverage (PR #4022 / #2118)

The new try_ring / try_group helpers replace the repeated match-or-return boilerplate that handled environments where io_uring is unavailable (CI sandboxes, seccomp, kernel < 5.6). No behavioural change; test coverage is preserved.

Test plan

  • cargo fmt --all -- --check passes.
  • cargo check -p fast_io --features io_uring --tests compiles cleanly.
  • cargo nextest run -p fast_io --features io_uring -E 'test(registered_buffers)' passes on Linux runners with io_uring available.
  • CI (fmt+clippy, nextest, Windows, macOS, Linux musl) is green.

The post-#4310 tests.rs at 882 lines exceeded the 650-line cap. Split
into a tests/ directory grouped by concern, each file well under cap:

- tests/mod.rs (39) - shared try_ring / try_group helpers and module decls.
- tests/registry.rs (113) - page size, validation guards, slot allocator.
- tests/submit.rs (179) - submit_read/write_fixed_batch helpers.
- tests/stats.rs (141) - acquire/miss counters and snapshot semantics.
- tests/status.rs (49) - try_new_with_status outcome reporting.
- tests/drop_contract.rs (309) - Drop semantics and constrained-env coverage
  for the PR #4022 / task #2118 fixed-buffer invariants audit.

The try_ring / try_group helpers replace the repeated match-or-return
boilerplate that handled environments where io_uring is unavailable
(CI sandboxes, seccomp, kernel < 5.6).

No behavioural change; test coverage is preserved.
@oferchen oferchen merged commit aebf7f7 into master May 17, 2026
3 of 14 checks passed
oferchen added a commit that referenced this pull request May 18, 2026
…ern (#4320)

The post-#4310 tests.rs at 882 lines exceeded the 650-line cap. Split
into a tests/ directory grouped by concern, each file well under cap:

- tests/mod.rs (39) - shared try_ring / try_group helpers and module decls.
- tests/registry.rs (113) - page size, validation guards, slot allocator.
- tests/submit.rs (179) - submit_read/write_fixed_batch helpers.
- tests/stats.rs (141) - acquire/miss counters and snapshot semantics.
- tests/status.rs (49) - try_new_with_status outcome reporting.
- tests/drop_contract.rs (309) - Drop semantics and constrained-env coverage
  for the PR #4022 / task #2118 fixed-buffer invariants audit.

The try_ring / try_group helpers replace the repeated match-or-return
boilerplate that handled environments where io_uring is unavailable
(CI sandboxes, seccomp, kernel < 5.6).

No behavioural change; test coverage is preserved.
oferchen added a commit that referenced this pull request May 18, 2026
…ern (#4320)

The post-#4310 tests.rs at 882 lines exceeded the 650-line cap. Split
into a tests/ directory grouped by concern, each file well under cap:

- tests/mod.rs (39) - shared try_ring / try_group helpers and module decls.
- tests/registry.rs (113) - page size, validation guards, slot allocator.
- tests/submit.rs (179) - submit_read/write_fixed_batch helpers.
- tests/stats.rs (141) - acquire/miss counters and snapshot semantics.
- tests/status.rs (49) - try_new_with_status outcome reporting.
- tests/drop_contract.rs (309) - Drop semantics and constrained-env coverage
  for the PR #4022 / task #2118 fixed-buffer invariants audit.

The try_ring / try_group helpers replace the repeated match-or-return
boilerplate that handled environments where io_uring is unavailable
(CI sandboxes, seccomp, kernel < 5.6).

No behavioural change; test coverage is preserved.
@oferchen oferchen deleted the refactor/registered-buffers-tests-split branch May 19, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant