Shilun Fan created RATIS-2777:
---------------------------------
Summary: Fix flaky leader lease tests
Key: RATIS-2777
URL: https://issues.apache.org/jira/browse/RATIS-2777
Project: Ratis
Issue Type: Test
Components: test
Reporter: Shilun Fan
Assignee: Shilun Fan
LeaderElectionTests.testLeaderLease intermittently fails in CI.
The related testLeaderLeaseDuringReconfiguration uses similar timing
assumptions and may also be flaky.
Failed CI job:
https://github.com/apache/ratis/actions/runs/39883138118/job/120184983184
The tests check lease validity immediately after a write completes.
However, a successful write does not guarantee that the lease is still valid
when the assertion runs.
With a lease duration of only 75ms, network or scheduling delays in CI may
cause it to expire before the check.
The tests also use a fixed sleep before checking lease expiry.
Additionally, assertLeaderLease reverses the expected and actual arguments,
making failure messages misleading.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)