• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

databendlabs / openraft / 24651845425
87%

Build:
DEFAULT BRANCH: main
Ran 20 Apr 2026 06:33AM UTC
Jobs 1
Files 261
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Apr 2026 06:28AM UTC coverage: 86.514%. Remained the same
24651845425

push

github

drmingdrmer
test: split turmoil invariants into module, add monotonic checks

Break the 500-line `tests-turmoil/src/invariants.rs` into `invariants/`
with one file per checker, driven by three goals:

1. Fix the CI `clippy::clone_on_copy` failures on `LeaderId<u64, u64>`
   (`Copy`) by dereferencing instead of cloning.
2. Broaden coverage against Vanlightly's TLA+ spec — the previous
   checker had no temporal per-node invariants.
3. Make each check individually testable; the old file had no unit
   tests.

The new `InvariantChecker` keeps two pieces of per-tick state: the
existing `Witness` (for Committed Immutable) and a new
`MonotonicHistory` (for the four monotonic properties).

Changes:

- Add `MonotonicTerm`, `MonotonicCommitIndex`, `MonotonicAppliedIndex`,
  `MonotonicVote` — Vanlightly-style non-regression checks comparing
  each node against its previous-tick snapshot.
- Fix a purged-boundary gap in `committed_immutable` and
  `log_matching`: iteration now starts at `purged.index` (not
  `purged.index + 1`) since `LogIdList::get(purged.index)` returns the
  purged log id, so a divergence right at the snapshot edge used to
  slip past.
- Replace `InvariantViolation::StateOrdering { reason: String }` with
  structured `{ lower, lower_index, higher, higher_index }` fields.
- Rename the fuzz-binary entry point from the free function
  `check_state_invariants()` to `InvariantChecker::check()` — stateful
  API needed for temporal invariants (the old free function could not
  retain cross-tick history).
- Add `src/invariants/tests.rs` with 16 unit tests driving a
  `SnapshotBuilder` fixture — one happy-path and one violation-path
  test per invariant, including a regression test for the
  purged-boundary fix.

Example:

    cargo test --lib invariants
    # 16 passed; 0 failed

16275 of 18812 relevant lines covered (86.51%)

120592.43 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
83.33
0.0% openraft/src/metrics/serde_instant.rs
Jobs
ID Job ID Ran Files Coverage
1 24651845425.1 20 Apr 2026 06:33AM UTC 261
86.51
GitHub Action Run
Source Files on build 24651845425
  • Tree
  • List 261
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24651845425
  • 9ade7985 on github
  • Prev Build on main (#24501237597)
  • Next Build on main (#24662436821)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc