bshashikant commented on a change in pull request #83:
URL: https://github.com/apache/incubator-ratis/pull/83#discussion_r419512537
##########
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:
Potentially , we can see both RaftRetryFailureException or
AlreadyClosedException depending on how tests are executed using the same
MiniRaftCluster. Let's add an OR condition here having both RaftRetryFailure or
AlreadyClosedException.
----------------------------------------------------------------
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]