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

databendlabs / openraft / 24138121229 / 1
91%
main: 87%

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

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.

9676 of 10699 relevant lines covered (90.44%)

7944.54 hits per line

Source Files on job 24138121229.1
  • Tree
  • List 150
  • Changed 45
  • Source Changed 1
  • Coverage Changed 45
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 24138121229
  • 6ff217da on github
  • Prev Job for on release-0.9 (#16233070462.1)
  • Next Job for on release-0.9 (#24141285464.1)
  • 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