Skip to content

test: add missing coverage for leader_state critical paths #357

Closed

Description

@JoshuaChi

Problem

Several critical paths in leader_state.rs have no test coverage:

  • handle_raft_event: StepDownSelfRemoved branch — leader steps down after self-removal (Raft membership change correctness)
  • verify_leadership_and_refresh_lease: LeadershipLost, RetryRequired, Err branches
  • conditionally_purge_zombie_nodes: entire BatchRemove path (Ok(true) / Ok(false) / Err)
  • BackpressureMetrics: record_rejection and record_buffer_utilization branches

Surfaced by Codecov on PR #355.

Acceptance Criteria

  • All four paths have unit tests in the corresponding leader_state_test/ files
  • cargo nextest run --all-features passes

Activity

  1. added this to the v0.2.4 milestone on Apr 12, 2026
  2. added theissue type on Apr 12, 2026
  3. added 3 commits that reference this issue on Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:enhancementNew feature or request for improvement

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions