You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "runzhiwang (Jira)" <ji...@apache.org> on 2020/04/26 08:13:00 UTC

[jira] [Commented] (RATIS-884) Failed UT: TestRaftLogMetrics.testRaftLogMetrics

    [ https://issues.apache.org/jira/browse/RATIS-884?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17092582#comment-17092582 ] 

runzhiwang commented on RATIS-884:
----------------------------------

[~shashikant] [~ljain] Could you help review it ? Thank you very much.

> Failed UT: TestRaftLogMetrics.testRaftLogMetrics
> ------------------------------------------------
>
>                 Key: RATIS-884
>                 URL: https://issues.apache.org/jira/browse/RATIS-884
>             Project: Ratis
>          Issue Type: Bug
>            Reporter: runzhiwang
>            Assignee: runzhiwang
>            Priority: Major
>         Attachments: RATIS-884.001.patch, screenshot-1.png, screenshot-2.png
>
>
> *What's the problem ?*
>  !screenshot-1.png! 
> *What's the reason ?*
> As the images shows, flushCount.incrementAndGet() happens in the 1st statement: stateMachine.flushStateMachineData(lastWrittenIndex), ratisMetricRegistry.get(RAFT_LOG_FLUSH_TIME) increase after the 2nd statement: timerContext.stop(). If the test Assert.assertEquals(expectedFlush, tm.getCount()) happens between 1st and 2nd statement, then the expectedFlush will be tm.getCount() + 1, so the test fail.
>  !screenshot-2.png! 
> *How to fix ?*
> Retry check expectedFlush == tm.getCount()



--
This message was sent by Atlassian Jira
(v8.3.4#803005)