adelapena commented on code in PR #2506:
URL: https://github.com/apache/cassandra/pull/2506#discussion_r1272517646


##########
test/unit/org/apache/cassandra/net/HandshakeTest.java:
##########
@@ -193,48 +193,31 @@ public void testSendCompatibleOldVersionPre40() throws 
InterruptedException
     }
 
     @Test
-    public void testSendIncompatibleOldVersionPre40() throws 
InterruptedException
+    public void testSendIncompatibleOldVersion40() throws InterruptedException
     {
         try
         {
-            handshake(VERSION_30, VERSION_30, VERSION_30, VERSION_3014, 
VERSION_3014);
-            Assert.fail("Should have thrown");
+            Assert.fail(Objects.toString(handshake(VERSION_30, VERSION_30, 
VERSION_30, current_version, current_version)));
         }
         catch (ExecutionException e)
         {
             assertTrue(e.getCause() instanceof ClosedChannelException);
         }
     }
 
-    @Test
-    public void testSendCompatibleOldVersion40() throws InterruptedException, 
ExecutionException
-    {
-        Result result = handshake(VERSION_30, VERSION_30, VERSION_30, 
VERSION_30, current_version);
-        Assert.assertEquals(Result.Outcome.SUCCESS, result.outcome);
-        Assert.assertEquals(VERSION_30, result.success().messagingVersion);
-    }
-
-    @Test
-    public void testSendIncompatibleOldVersion40() throws InterruptedException
+    @Test // fairly contrived case, but since we introduced logic for testing 
we need to be careful it doesn't make us worse
+    public void testSendToFuturePost40BelievedToBePre40() throws 
InterruptedException, ExecutionException
     {
         try
         {
-            Assert.fail(Objects.toString(handshake(VERSION_30, VERSION_30, 
VERSION_30, current_version, current_version)));
+            Assert.fail(Objects.toString(handshake(VERSION_30, VERSION_30, 
current_version, VERSION_30, current_version + 1)));

Review Comment:
   Same for `testSendCompatibleOldVersion40` and 
`testSendIncompatibleOldVersion40` right above.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to