You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ratis.apache.org by GitBox <gi...@apache.org> on 2020/04/27 08:03:44 UTC

[GitHub] [incubator-ratis] runzhiwang opened a new pull request #66: RATIS-884. Fix Failed UT: TestRaftLogMetrics.testRaftLogMetrics

runzhiwang opened a new pull request #66:
URL: https://github.com/apache/incubator-ratis/pull/66


   **What's the problem ?**
   ![image](https://user-images.githubusercontent.com/51938049/80348528-807c5c00-88a0-11ea-9069-78f7f56b02f7.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.
   
   ![image](https://user-images.githubusercontent.com/51938049/80348569-8eca7800-88a0-11ea-8d19-f2965c94a584.png)
   
   **How to fix ?**
   Retry check expectedFlush == tm.getCount()


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-ratis] runzhiwang commented on pull request #66: RATIS-884. Fix Failed UT: TestRaftLogMetrics.testRaftLogMetrics

Posted by GitBox <gi...@apache.org>.
runzhiwang commented on pull request #66:
URL: https://github.com/apache/incubator-ratis/pull/66#issuecomment-621199915


   @lokeshj1703  It can not be fixed by RATIS-881, it was caused by UT and Ratis Use different thread. And I test it again, it still happen.  To easy reproduce, you can add Thead.sleep(1000) to delay the timerContext.stop(), it will happen.
   ![image](https://user-images.githubusercontent.com/51938049/80600346-d7c82b00-8a5e-11ea-86ae-0f713b5bb288.png)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-ratis] lokeshj1703 commented on pull request #66: RATIS-884. Fix Failed UT: TestRaftLogMetrics.testRaftLogMetrics

Posted by GitBox <gi...@apache.org>.
lokeshj1703 commented on pull request #66:
URL: https://github.com/apache/incubator-ratis/pull/66#issuecomment-622000227


   @runzhiwang  Thanks for the contribution! I have merged the PR to master branch.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-ratis] runzhiwang edited a comment on pull request #66: RATIS-884. Fix Failed UT: TestRaftLogMetrics.testRaftLogMetrics

Posted by GitBox <gi...@apache.org>.
runzhiwang edited a comment on pull request #66:
URL: https://github.com/apache/incubator-ratis/pull/66#issuecomment-621199915


   @lokeshj1703  It can not be fixed by RATIS-881, it was caused by UT and Ratis Use different threads, and can not reproduce every time. And I test it again, it still happen.  To easy reproduce, you can add Thead.sleep(1000) between statement 1 and statement 2 to delay the timerContext.stop(), it will happen.
   ![image](https://user-images.githubusercontent.com/51938049/80600346-d7c82b00-8a5e-11ea-86ae-0f713b5bb288.png)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-ratis] lokeshj1703 commented on pull request #66: RATIS-884. Fix Failed UT: TestRaftLogMetrics.testRaftLogMetrics

Posted by GitBox <gi...@apache.org>.
lokeshj1703 commented on pull request #66:
URL: https://github.com/apache/incubator-ratis/pull/66#issuecomment-621191727


   @runzhiwang We don't see this failure in latest runs? Do you think this was fixed by RATIS-881?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-ratis] runzhiwang edited a comment on pull request #66: RATIS-884. Fix Failed UT: TestRaftLogMetrics.testRaftLogMetrics

Posted by GitBox <gi...@apache.org>.
runzhiwang edited a comment on pull request #66:
URL: https://github.com/apache/incubator-ratis/pull/66#issuecomment-621199915


   @lokeshj1703  It can not be fixed by RATIS-881, it was caused by UT and Ratis Use different threads, and can not reproduce every time. And I test it again, it still happen.  To easy reproduce, you can add Thead.sleep(1000) to delay the timerContext.stop(), it will happen.
   ![image](https://user-images.githubusercontent.com/51938049/80600346-d7c82b00-8a5e-11ea-86ae-0f713b5bb288.png)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-ratis] runzhiwang edited a comment on pull request #66: RATIS-884. Fix Failed UT: TestRaftLogMetrics.testRaftLogMetrics

Posted by GitBox <gi...@apache.org>.
runzhiwang edited a comment on pull request #66:
URL: https://github.com/apache/incubator-ratis/pull/66#issuecomment-621199915


   @lokeshj1703  It can not be fixed by RATIS-881, it was caused by UT and Ratis Use different thread, and can not reproduce every time. And I test it again, it still happen.  To easy reproduce, you can add Thead.sleep(1000) to delay the timerContext.stop(), it will happen.
   ![image](https://user-images.githubusercontent.com/51938049/80600346-d7c82b00-8a5e-11ea-86ae-0f713b5bb288.png)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org