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/10/30 09:16:53 UTC

[GitHub] [incubator-ratis] szetszwo commented on a change in pull request #243: RATIS-1121. Support multiple streams.

szetszwo commented on a change in pull request #243:
URL: https://github.com/apache/incubator-ratis/pull/243#discussion_r514961932



##########
File path: ratis-test/src/test/java/org/apache/ratis/datastream/TestDataStreamBase.java
##########
@@ -205,14 +228,19 @@ private void runTestDataStream(int bufferSize, int bufferNum) {
       Assert.assertEquals(reply.getType(), Type.STREAM_DATA);
     }
 
-    for (SingleDataStreamStateMachine s : singleDataStreamStateMachines) {
-      RaftClientRequest writeRequest = s.getWriteRequest();
-      if (writeRequest.getClientId().equals(impl.getHeader().getClientId())) {
-        Assert.assertEquals(writeRequest.getCallId(), impl.getHeader().getCallId());
-        Assert.assertEquals(writeRequest.getRaftGroupId(), impl.getHeader().getRaftGroupId());
-        Assert.assertEquals(writeRequest.getServerId(), impl.getHeader().getServerId());
+    final RaftClientRequest header = out.getHeader();
+    for (MultiDataStreamStateMachine s : stateMachines) {
+      final SingleDataStream stream = s.getSingleDataStream(header.getCallId());
+      if (stream == null) {
+        continue;
+      }

Review comment:
       Assert.assertNotNull(stream) will fail the test when stream == null. It is a possible case when there are multiple servers.   




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