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



##########
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:
       Maybe we can `Assert.assertNotNull(stream)` instead of `continue `?




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