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

databendlabs / openraft / 24138121229
91%
main: 87%

Build:
Build:
LAST BUILD BRANCH: release-0.10
DEFAULT BRANCH: main
Ran 08 Apr 2026 01:42PM UTC
Jobs 1
Files 150
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

08 Apr 2026 12:45PM UTC coverage: 90.438% (+0.3%) from 90.122%
24138121229

push

github

drmingdrmer
Fix: prevent redundant election when single voter is already electing

When a single-voter node calls `elect()` during `initialize()`, it
becomes a Candidate with an uncommitted vote. Before the vote flush
completes, an election tick can fire and trigger a second `elect()`,
bumping the term unnecessarily (e.g., T1 → T2). This caused flaky
test failures in `single-term-leader` mode where `new_cluster()`
expected `vote == <T1-N0:Q>` but observed `<T2-N0:Q>`.

The fix checks `candidate_ref().is_some()` to detect an in-progress
election. This is precise because the `Candidate` struct only exists
between an `elect()` call and becoming Leader — it is never present
after a node restart, unlike vote-based checks (`is_leading()`) which
would incorrectly match persisted votes from a previous run.

2 of 4 new or added lines in 1 file covered. (50.0%)

13 existing lines in 4 files now uncovered.

9676 of 10699 relevant lines covered (90.44%)

7944.54 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
88.2
0.25% openraft/src/core/raft_core.rs

Coverage Regressions

Lines Coverage ∆ File
7
54.8
-3.95% openraft/src/error.rs
2
75.0
-1.19% openraft/src/core/notify.rs
2
91.14
-1.36% openraft/src/core/tick.rs
2
55.56
-5.56% openraft/src/error/decompose.rs
Jobs
ID Job ID Ran Files Coverage
1 24138121229.1 08 Apr 2026 01:42PM UTC 150
90.44
GitHub Action Run
Source Files on build 24138121229
  • Tree
  • List 150
  • Changed 45
  • Source Changed 1
  • Coverage Changed 45
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24138121229
  • 6ff217da on github
  • Prev Build on release-0.9 (#16233070462)
  • Next Build on release-0.9 (#24141285464)
  • 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