Skip to content

chore(timer): split inline tests out of timer.rs after #8328 - #8355

Merged
proggeramlug merged 1 commit into
mainfrom
chore/split-timer-tests
Aug 18, 2026
Merged

chore(timer): split inline tests out of timer.rs after #8328#8355
proggeramlug merged 1 commit into
mainfrom
chore/split-timer-tests

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

#8328 landed from a fork branch that pushed crates/perry-runtime/src/timer.rs to
2001 lines, one over the 2000-line cap in scripts/check_file_size.sh. I could
not push to the fork, so this applies the split immediately after the merge rather
than bouncing an otherwise-green PR over one line.

Changes

  • Move the trailing #[cfg(test)] block (234 lines) to
    crates/perry-runtime/src/timer/tests_inline.rs behind a #[path] + mod
    declaration, following the box/release_tests.rs precedent from fix(runtime): release closure-visible async boxes #8303.
  • Re-export it under #[cfg(test)]: several helpers are reached from other
    modules as crate::timer::test_clear_timer_scanner_roots and friends, so the
    bare extraction broke nine call sites. The re-export restores the original
    paths.

Validation

  • scripts/check_file_size.sh — exit 0 (timer.rs now 1775 lines)
  • cargo test -p perry-runtime --lib2585 passed, 0 failed, the same count
    as before the split, so no test was dropped by the move
  • cargo fmt --all

Summary by CodeRabbit

  • Tests

    • Expanded timer coverage for deadline ordering, stable ordering of equal deadlines, and timeout precedence over immediate callbacks.
    • Added validation for expired-timer processing and timer state cleanup.
  • Chores

    • Reorganized timer test code to improve maintainability without changing runtime behavior.

#8328 pushed timer.rs to 2001 lines, one over the check_file_size.sh cap.
Move the trailing #[cfg(test)] block to timer/tests_inline.rs behind a
#[path] mod, following the box/release_tests.rs precedent, and re-export it
so the helpers other modules reach as crate::timer::* still resolve.
@proggeramlug
proggeramlug merged commit 0e5aae6 into main Aug 18, 2026
19 checks passed
@proggeramlug
proggeramlug deleted the chore/split-timer-tests branch August 18, 2026 08:58
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b644f94a-f4dd-4450-9fea-d1cad7941d07

📥 Commits

Reviewing files that changed from the base of the PR and between 91ecdf7 and 967ae5c.

📒 Files selected for processing (3)
  • changelog.d/8355-split-timer-tests.md
  • crates/perry-runtime/src/timer.rs
  • crates/perry-runtime/src/timer/tests_inline.rs

📝 Walkthrough

Walkthrough

The inline timer test helpers and tests moved from timer.rs into timer/tests_inline.rs. The timer module re-exports the extracted items. New tests cover deadline ordering, stable equal-deadline ordering, and timeout precedence over immediates.

Changes

Timer test extraction

Layer / File(s) Summary
Module extraction and path preservation
crates/perry-runtime/src/timer.rs, crates/perry-runtime/src/timer/tests_inline.rs
The test module and test-only identifiers moved into tests_inline.rs. timer.rs conditionally includes and re-exports the extracted items.
Timer test fixtures and scanner helpers
crates/perry-runtime/src/timer/tests_inline.rs
Test helpers seed, inspect, and clear timeout, callback, and interval timer roots.
Timer ordering tests and changelog
crates/perry-runtime/src/timer/tests_inline.rs, changelog.d/8355-split-timer-tests.md
Tests validate deadline ordering, stable ordering for equal deadlines, and timeout precedence over FIFO immediates. The changelog records the file split.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: tooling

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/split-timer-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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