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

databendlabs / openraft / 24136120416
86%

Build:
DEFAULT BRANCH: main
Ran 08 Apr 2026 12:51PM UTC
Jobs 1
Files 260
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:40PM UTC coverage: 85.972% (-0.02%) from 85.991%
24136120416

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%)

6 existing lines in 3 files now uncovered.

15959 of 18563 relevant lines covered (85.97%)

120574.6 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
92.02
-0.19% openraft/src/core/raft_core.rs

Coverage Regressions

Lines Coverage ∆ File
3
84.62
-4.62% openraft/src/raft/raft_inner.rs
2
90.91
-2.6% openraft/src/core/tick.rs
1
83.33
0.0% openraft/src/metrics/serde_instant.rs
Jobs
ID Job ID Ran Files Coverage
1 24136120416.1 08 Apr 2026 12:51PM UTC 260
85.97
GitHub Action Run
Source Files on build 24136120416
  • Tree
  • List 260
  • Changed 5
  • Source Changed 1
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24136120416
  • 558e1b94 on github
  • Prev Build on main (#24069326344)
  • Next Build on main (#24178945835)
  • 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