You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "atu-sharm (via GitHub)" <gi...@apache.org> on 2023/12/01 07:09:30 UTC

[PR] Flaky test - testSyncTopicConfigs() – org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationBaseTest [kafka]

atu-sharm opened a new pull request, #14893:
URL: https://github.com/apache/kafka/pull/14893

   Added a method, waitForConfigValueChange, to wait for a configuration value change in an EmbeddedKafkaCluster after using the incrementalAlterConfigs API.
   
   The test, testSyncTopicConfigs, appears to be flaky (as seen in https://ci-builds.apache.org/blue/organizations/jenkins/Kafka%2Fkafka-pr/detail/PR-14811/7/tests). This seems to be because we assert to check the updated values of the configuration before waiting for it to change.


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-15945 : Flaky test - testSyncTopicConfigs() – org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationBaseTest [kafka]

Posted by "C0urante (via GitHub)" <gi...@apache.org>.
C0urante commented on code in PR #14893:
URL: https://github.com/apache/kafka/pull/14893#discussion_r1415954634


##########
connect/mirror/src/test/resources/log4j.properties:
##########
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 ##
-log4j.rootLogger=ERROR, stdout
+log4j.rootLogger=INFO, stdout

Review Comment:
   If this is only here for testing, it's fine. But we shouldn't merge this change. If it'd be useful to see specific logging namespaces at `INFO` level, we can make focused changes to just those namespaces instead of adjusting the root level.



-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-15945 : Flaky test - testSyncTopicConfigs() – org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationBaseTest [kafka]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #14893:
URL: https://github.com/apache/kafka/pull/14893#issuecomment-2050904251

   This PR is being marked as stale since it has not had any activity in 90 days. If you would like to keep this PR alive, please ask a committer for review. If the PR has  merge conflicts, please update it with the latest from trunk (or appropriate release branch) <p> If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 30 days, it will be automatically closed.


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-15945 : Flaky test - testSyncTopicConfigs() – org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationBaseTest [kafka]

Posted by "C0urante (via GitHub)" <gi...@apache.org>.
C0urante commented on code in PR #14893:
URL: https://github.com/apache/kafka/pull/14893#discussion_r1415960042


##########
connect/mirror/src/test/java/org/apache/kafka/connect/mirror/integration/MirrorConnectorsIntegrationBaseTest.java:
##########
@@ -770,6 +771,9 @@ public void testSyncTopicConfigs() throws InterruptedException {
         Map<ConfigResource, Collection<AlterConfigOp>> configOps = Collections.singletonMap(configResource, ops);
         // alter configs on target cluster
         backup.kafka().incrementalAlterConfigs(configOps);
+        // wait until the configs are changed
+        waitForConfigValueChange(backup, backupTopic, "delete.retention.ms", "2000");
+        waitForConfigValueChange(backup, backupTopic, "retention.bytes", "2000");

Review Comment:
   @ashwinpankaj I looked into the suggestion to wait on the returned futures as it seemed quite promising, but it turns out that we already do that in the body of `EmbeddedKafkaCluster::incrementalAlterConfigs`: https://github.com/apache/kafka/blob/587f50d48f832f2ce76ed8f47b6ea472da3b0848/connect/runtime/src/test/java/org/apache/kafka/connect/util/clusters/EmbeddedKafkaCluster.java#L368-L370
   
   Because of this, though, I'm pretty skeptical that any extra assertions about config changes making it to the backup cluster are going to be beneficial. We also perform assertions about propagated config updates inside a `waitForCondition` call, so there should already be bounded retry logic to handle potential delays in propagation. Maybe we just don't give enough time for that to work on Jenkins?
   
   @atu-sharm have you considered adding more informative error messages to the [currently-failing assertion](https://github.com/apache/kafka/blob/587f50d48f832f2ce76ed8f47b6ea472da3b0848/connect/mirror/src/test/java/org/apache/kafka/connect/mirror/integration/MirrorConnectorsIntegrationBaseTest.java#L775-L789)? That may be useful for distinguishing between failures caused by legitimate bugs, bad testing logic, and timeouts that are too short for our CI machinery.



-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-15945 : Flaky test - testSyncTopicConfigs() – org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationBaseTest [kafka]

Posted by "atu-sharm (via GitHub)" <gi...@apache.org>.
atu-sharm commented on code in PR #14893:
URL: https://github.com/apache/kafka/pull/14893#discussion_r1433807388


##########
connect/mirror/src/test/java/org/apache/kafka/connect/mirror/integration/MirrorConnectorsIntegrationBaseTest.java:
##########
@@ -770,6 +771,9 @@ public void testSyncTopicConfigs() throws InterruptedException {
         Map<ConfigResource, Collection<AlterConfigOp>> configOps = Collections.singletonMap(configResource, ops);
         // alter configs on target cluster
         backup.kafka().incrementalAlterConfigs(configOps);
+        // wait until the configs are changed
+        waitForConfigValueChange(backup, backupTopic, "delete.retention.ms", "2000");
+        waitForConfigValueChange(backup, backupTopic, "retention.bytes", "2000");

Review Comment:
   Thanks, @ashwinpankaj, @C0urante, and @mimaison for taking the time to look into this. I agree with @C0urante. Since we have waited for all the results to come in and backup.kafka().incrementalAlterConfigs(configOps) didn't fail with any exceptions, further assertions to confirm that the configs have been set may not be beneficial.
   
   Currently, the test fails with the delete.retention.ms value as 86400000 (which is the default value). As I'm new here, could you please provide more insights? There are multiple tests (namely testSyncTopicConfigs, testReplicateSourceDefault, testReplicateTargetDefault) and multiple classes extending this test class (IdentityReplicationIntegrationTest, MirrorConnectorsIntegrationExactlyOnceTest, etc). Is it possible that these tests, which are calling MM or altering the same topic config and if are running on different Gradle executors, could encounter a race condition and cause the tests to fail?



-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-15945 : Flaky test - testSyncTopicConfigs() – org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationBaseTest [kafka]

Posted by "mimaison (via GitHub)" <gi...@apache.org>.
mimaison commented on PR #14893:
URL: https://github.com/apache/kafka/pull/14893#issuecomment-1839148756

   Thanks for looking into this flaky test!
   It seems it still failed with this change: https://ci-builds.apache.org/job/Kafka/job/kafka-pr/job/PR-14893/4/testReport/junit/org.apache.kafka.connect.mirror.integration/MirrorConnectorsWithCustomForwardingAdminIntegrationTest/Build___JDK_8_and_Scala_2_12___testSyncTopicConfigs__/


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-15945 : Flaky test - testSyncTopicConfigs() – org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationBaseTest [kafka]

Posted by "OmniaGM (via GitHub)" <gi...@apache.org>.
OmniaGM commented on code in PR #14893:
URL: https://github.com/apache/kafka/pull/14893#discussion_r1427819819


##########
connect/mirror/src/test/java/org/apache/kafka/connect/mirror/integration/MirrorConnectorsIntegrationBaseTest.java:
##########
@@ -920,13 +923,13 @@ String remoteTopicName(String topic, String clusterAlias) {
      * launch the connectors on kafka connect cluster and check if they are running
      */
     protected static void waitUntilMirrorMakerIsRunning(EmbeddedConnectCluster connectCluster,
-            List<Class<? extends Connector>> connectorClasses, MirrorMakerConfig mm2Config, 
+            List<Class<? extends Connector>> connectorClasses, MirrorMakerConfig mm2Config,
             String primary, String backup) throws InterruptedException {
         for (Class<? extends Connector> connector : connectorClasses) {
             connectCluster.configureConnector(connector.getSimpleName(), mm2Config.connectorBaseConfig(
                 new SourceAndTarget(primary, backup), connector));
         }
-        

Review Comment:
   Would be nice to get ripped off these reformatting new lines changes as they are unnecessary 



-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-15945 : Flaky test - testSyncTopicConfigs() – org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationBaseTest [kafka]

Posted by "atu-sharm (via GitHub)" <gi...@apache.org>.
atu-sharm commented on code in PR #14893:
URL: https://github.com/apache/kafka/pull/14893#discussion_r1433864949


##########
connect/mirror/src/test/java/org/apache/kafka/connect/mirror/integration/MirrorConnectorsIntegrationBaseTest.java:
##########
@@ -770,6 +771,9 @@ public void testSyncTopicConfigs() throws InterruptedException {
         Map<ConfigResource, Collection<AlterConfigOp>> configOps = Collections.singletonMap(configResource, ops);
         // alter configs on target cluster
         backup.kafka().incrementalAlterConfigs(configOps);
+        // wait until the configs are changed
+        waitForConfigValueChange(backup, backupTopic, "delete.retention.ms", "2000");
+        waitForConfigValueChange(backup, backupTopic, "retention.bytes", "2000");

Review Comment:
   As of now, i have added a lock for running the testcases which involves altering of same topic configs, your thoughts @C0urante @ashwinpankaj @mimaison 



-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-15945 : Flaky test - testSyncTopicConfigs() – org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationBaseTest [kafka]

Posted by "ashwinpankaj (via GitHub)" <gi...@apache.org>.
ashwinpankaj commented on code in PR #14893:
URL: https://github.com/apache/kafka/pull/14893#discussion_r1411813212


##########
connect/mirror/src/test/java/org/apache/kafka/connect/mirror/integration/MirrorConnectorsIntegrationBaseTest.java:
##########
@@ -770,6 +771,9 @@ public void testSyncTopicConfigs() throws InterruptedException {
         Map<ConfigResource, Collection<AlterConfigOp>> configOps = Collections.singletonMap(configResource, ops);
         // alter configs on target cluster
         backup.kafka().incrementalAlterConfigs(configOps);
+        // wait until the configs are changed
+        waitForConfigValueChange(backup, backupTopic, "delete.retention.ms", "2000");
+        waitForConfigValueChange(backup, backupTopic, "retention.bytes", "2000");

Review Comment:
   thanks looking into this @atu-sharm !
   
   I wonder if a wait for `retention.bytes` to be equal to 2000 will always succeed.
   waitForCondition has a default poll interval of 100 ms. If the value is set to 2000 and then changed to 1000 by MirrorMaker within the time the thread sleeps (100ms) , we may miss the value change and timeout.
   
   Can't we just wait on the futures returned by incrementalAlterConfigs ?



-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-15945 : Flaky test - testSyncTopicConfigs() – org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationBaseTest [kafka]

Posted by "atu-sharm (via GitHub)" <gi...@apache.org>.
atu-sharm commented on PR #14893:
URL: https://github.com/apache/kafka/pull/14893#issuecomment-1835716040

   Hi @mimaison @C0urante can you have a look at this once?


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-15945 : Flaky test - testSyncTopicConfigs() – org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationBaseTest [kafka]

Posted by "atu-sharm (via GitHub)" <gi...@apache.org>.
atu-sharm commented on code in PR #14893:
URL: https://github.com/apache/kafka/pull/14893#discussion_r1433808036


##########
connect/mirror/src/test/resources/log4j.properties:
##########
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 ##
-log4j.rootLogger=ERROR, stdout
+log4j.rootLogger=INFO, stdout

Review Comment:
   Yes, this was for debugging will remove once the testing is done



-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-15945 : Flaky test - testSyncTopicConfigs() – org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationBaseTest [kafka]

Posted by "gharris1727 (via GitHub)" <gi...@apache.org>.
gharris1727 commented on code in PR #14893:
URL: https://github.com/apache/kafka/pull/14893#discussion_r1450758420


##########
connect/mirror/src/test/java/org/apache/kafka/connect/mirror/integration/MirrorConnectorsIntegrationBaseTest.java:
##########
@@ -101,8 +101,9 @@
  */
 @Tag("integration")
 public class MirrorConnectorsIntegrationBaseTest {
+    private static final Object TOPIC_LOCK = new Object();

Review Comment:
   Can you explain what this lock is accomplishing? There's only one test running at a time within the suite.



-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-15945 : Flaky test - testSyncTopicConfigs() – org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationBaseTest [kafka]

Posted by "atu-sharm (via GitHub)" <gi...@apache.org>.
atu-sharm commented on code in PR #14893:
URL: https://github.com/apache/kafka/pull/14893#discussion_r1433870598


##########
connect/mirror/src/test/java/org/apache/kafka/connect/mirror/integration/MirrorConnectorsIntegrationBaseTest.java:
##########
@@ -920,13 +923,13 @@ String remoteTopicName(String topic, String clusterAlias) {
      * launch the connectors on kafka connect cluster and check if they are running
      */
     protected static void waitUntilMirrorMakerIsRunning(EmbeddedConnectCluster connectCluster,
-            List<Class<? extends Connector>> connectorClasses, MirrorMakerConfig mm2Config, 
+            List<Class<? extends Connector>> connectorClasses, MirrorMakerConfig mm2Config,
             String primary, String backup) throws InterruptedException {
         for (Class<? extends Connector> connector : connectorClasses) {
             connectCluster.configureConnector(connector.getSimpleName(), mm2Config.connectorBaseConfig(
                 new SourceAndTarget(primary, backup), connector));
         }
-        

Review Comment:
   Sure @OmniaGM, thanks  :)



-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-15945 : Flaky test - testSyncTopicConfigs() – org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationBaseTest [kafka]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #14893:
URL: https://github.com/apache/kafka/pull/14893#issuecomment-2568654940

   This PR has been closed since it has not had any activity in 120 days. If you feel like this
   was a mistake, or you would like to continue working on it, please feel free to re-open the 
   PR and ask for a review.


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-15945 : Flaky test - testSyncTopicConfigs() – org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationBaseTest [kafka]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #14893: KAFKA-15945 : Flaky test - testSyncTopicConfigs() – org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationBaseTest
URL: https://github.com/apache/kafka/pull/14893


-- 
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-unsubscribe@kafka.apache.org

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