mjsax commented on code in PR #18988:
URL: https://github.com/apache/kafka/pull/18988#discussion_r1964741210


##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/assignment/AssignorConfigurationTest.java:
##########
@@ -54,30 +54,25 @@ public void configsShouldRejectZeroWarmups() {
     }
 
     @Test
-    public void rebalanceProtocolShouldSupportAllUpgradeFromVersions() {
+    public void 
shouldSupportAllUpgradeFromVersionsFromCooperativeRebalancingOn() {
+        boolean beforeCooperative = true;
         for (final UpgradeFromValues upgradeFrom : UpgradeFromValues.values()) 
{
-            config.put(StreamsConfig.UPGRADE_FROM_CONFIG, 
upgradeFrom.toString());
-            final AssignorConfiguration assignorConfiguration = new 
AssignorConfiguration(config);
-
-            try {
-                assignorConfiguration.rebalanceProtocol();
-            } catch (final Exception error) {
-                throw new AssertionError("Upgrade from " + upgradeFrom + " 
failed with " + error.getMessage() + "!");
+            if (upgradeFrom.toString().equals("2.4")) {

Review Comment:
   Yes, we loop, but when `upgradeFrom` changes, should the condition not be:
   ```
   if (upgradeFrom.toString().equals("2.4")
       || upgradeFrom.toString().equals("2.5")
      ...
       || upgradeFrom.toString().equals("3.9")
       // need to add a new version here for every new release    
       ) {
   ```
   Otherwise we set `beforeCooperative = false` only for a single loop 
iteration when `upgradeFrom = 2.4` ?
   
   What actually makes me suggest to flip from logic and initialize 
`beforeCooperative = false`, and set it to `true` for versions 0.10.0 to 2.3 to 
avoid that we need to keep updating this test for very future release (what we 
would most likely forget...)



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to