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/05/03 04:57:24 UTC

[GitHub] [incubator-ratis] bshashikant commented on a change in pull request #83: RATIS-901. Fix Failed UT: WatchRequestTests.testWatchRequestClientTimeout

bshashikant commented on a change in pull request #83:
URL: https://github.com/apache/incubator-ratis/pull/83#discussion_r419047623



##########
File path: ratis-server/src/test/java/org/apache/ratis/WatchRequestTests.java
##########
@@ -457,8 +460,13 @@ static void runTestWatchRequestClientTimeout(TestParameters p) throws Exception
           ex.getCause().getClass());
       if (ex.getCause() != null) {
         if (ex.getCause().getCause() != null) {
-          Assert.assertEquals(TimeoutIOException.class,
-              ex.getCause().getCause().getClass());
+          // when client closed and throw TimeoutException,
+          // RaftClientImpl::handleIOException will random select a leader
+          // because suggested new leader is null.

Review comment:
       I think probbaly, we should ensure there is no retry in the test by setting the attempt count to 1 in the retry policy.. In such case, it will always fail consistently with TimeoutException which is the goal here. 




----------------------------------------------------------------
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