szetszwo commented on code in PR #1446:
URL: https://github.com/apache/ratis/pull/1446#discussion_r3189695705


##########
ratis-server/src/test/java/org/apache/ratis/ReadOnlyRequestTests.java:
##########
@@ -299,20 +300,40 @@ private void testReadAfterWriteImpl(CLUSTER cluster) 
throws Exception {
       Assertions.assertEquals(1, retrieve(blockReply));
 
       // test asynchronous read-after-write
-      client.async().send(incrementMessage);
-      client.async().sendReadAfterWrite(queryMessage).thenAccept(reply -> {
-        Assertions.assertEquals(2, retrieve(reply));
-      });
+      client.async().send(incrementMessage).get();

Review Comment:
   The sendReadAfterWrite feature is for two async calls, (1) writeAsync and 
then (2) readAfterWriteAsync such that (2) must be able see the change by (1).  
So, we cannot call get() here.  Otherwise, the test becomes useless.  For 
exampe,
   
   0. initial: X  = 1
   1. writeAsync: set X = 3
   2. readAfterWriteAsync: must see X = 3 (it is a bug if it can see X = 1)
   
   This may be a bug already fixed (and moved to LinearizableReadTests) in the 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to