showuon commented on code in PR #13631:
URL: https://github.com/apache/kafka/pull/13631#discussion_r1176025802


##########
metadata/src/test/java/org/apache/kafka/metadata/migration/KRaftMigrationDriverTest.java:
##########
@@ -383,8 +466,8 @@ public ZkMigrationLeadershipState 
claimControllerLeadership(ZkMigrationLeadershi
             driver.onMetadataUpdate(delta, image, new 
LogDeltaManifest(provenance,
                 new LeaderAndEpoch(OptionalInt.of(3000), 1), 1, 100, 42));
             Assertions.assertTrue(claimLeaderAttempts.await(1, 
TimeUnit.MINUTES));
-            TestUtils.waitForCondition(() -> driver.migrationState().get(1, 
TimeUnit.MINUTES).equals(MigrationDriverState.ZK_MIGRATION),
-                "Waiting for KRaftMigrationDriver to enter ZK_MIGRATION 
state");
+            TestUtils.waitForCondition(() -> driver.migrationState().get(1, 
TimeUnit.MINUTES).equals(MigrationDriverState.DUAL_WRITE),
+                "Waiting for KRaftMigrationDriver to enter DUAL_WRITE state");

Review Comment:
   This test failed sometimes because `ZK_MIGRATION` is just a middle state, so 
we might miss to get this state and cause the test failure. Changing to verify 
the `DUAL_WRITE` state which will be more reliable. This will also verify the 
`ZK_MIGRATION` state because we can't jump to `DUAL_WRITE` directly.



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