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



##########
File path: ratis-server/src/test/java/org/apache/ratis/WatchRequestTests.java
##########
@@ -446,14 +445,18 @@ static void 
runTestWatchRequestClientTimeout(TestParameters p) throws Exception
     final Logger LOG = p.log;
 
     CompletableFuture<RaftClientReply> watchReply;
-    watchReply = p.sendWatchRequest(1000);
+    // watch 1000 which will never be committed
+    // so client can not receive reply, and connection closed, throw 
TimeoutException.
+    // We should not retry, because if retry, 
RaftClientImpl::handleIOException will random select a leader,
+    // then sometimes throw NotLeaderException.
+    watchReply = p.sendWatchRequest(1000, RetryPolicies.noRetry());
 
     try {
       watchReply.get();
       fail("runTestWatchRequestClientTimeout failed");
     } catch (Exception ex) {
       LOG.error("error occurred", ex);
-      Assert.assertEquals(RaftRetryFailureException.class,
+      Assert.assertEquals(AlreadyClosedException.class,

Review comment:
       @bshashikant Thanks for your review. I have updated.




----------------------------------------------------------------
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:
[email protected]


Reply via email to