[
https://issues.apache.org/jira/browse/RATIS-2726?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rui Wang resolved RATIS-2726.
-----------------------------
Fix Version/s: 3.4.0
Resolution: Fixed
> testFollowerHeartbeatMetric may fail after a leader steps down
> --------------------------------------------------------------
>
> Key: RATIS-2726
> URL: https://issues.apache.org/jira/browse/RATIS-2726
> Project: Ratis
> Issue Type: Bug
> Components: test
> Reporter: Shilun Fan
> Assignee: Shilun Fan
> Priority: Minor
> Fix For: 3.4.0
>
> Time Spent: 3h 10m
> Remaining Estimate: 0h
>
> {{testFollowerHeartbeatMetric assumes that a follower's metric registry
> contains no lastHeartbeatElapsedTime gauges.}}
> However, a follower may have previously been the leader.
> {{When it steps down, its registry is unregistered from
> MetricRegistries.global(), but the registry object still retains its gauges.}}
> {{The test reads this object directly and may fail:}}
> {code:java}
> org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
> at
> org.apache.ratis.LogAppenderTests.testFollowerHeartbeatMetric(LogAppenderTests.java:167)
> {code}
> {{In the failing CI run, s2 became leader, then stepped down, and s1 became
> the new leader.}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)