You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by rh...@apache.org on 2020/02/13 00:50:29 UTC
[kafka] branch 2.4 updated: MINOR: Fix poor backport that prevented
compiling the MirrorMaker integration test (#8102)
This is an automated email from the ASF dual-hosted git repository.
rhauch pushed a commit to branch 2.4
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/2.4 by this push:
new 161ffe1 MINOR: Fix poor backport that prevented compiling the MirrorMaker integration test (#8102)
161ffe1 is described below
commit 161ffe155ebfd9b3b6612601d8868332cc143104
Author: Randall Hauch <rh...@gmail.com>
AuthorDate: Wed Feb 12 18:50:01 2020 -0600
MINOR: Fix poor backport that prevented compiling the MirrorMaker integration test (#8102)
Author: Randall Hauch <rh...@gmail.com>
Reviewer: Jason Gustafson <ja...@confluent.io>
---
.../kafka/connect/mirror/MirrorConnectorsIntegrationTest.java | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/connect/mirror/src/test/java/org/apache/kafka/connect/mirror/MirrorConnectorsIntegrationTest.java b/connect/mirror/src/test/java/org/apache/kafka/connect/mirror/MirrorConnectorsIntegrationTest.java
index 8ae8df3..8b1bac9 100644
--- a/connect/mirror/src/test/java/org/apache/kafka/connect/mirror/MirrorConnectorsIntegrationTest.java
+++ b/connect/mirror/src/test/java/org/apache/kafka/connect/mirror/MirrorConnectorsIntegrationTest.java
@@ -154,6 +154,13 @@ public class MirrorConnectorsIntegrationTest {
mm2Props.put("backup.bootstrap.servers", backup.kafka().bootstrapServers());
mm2Config = new MirrorMakerConfig(mm2Props);
+ // we wait for the connector and tasks to come up for each connector, so that when we do the
+ // actual testing, we are certain that the tasks are up and running; this will prevent
+ // flaky tests where the connector and tasks didn't start up in time for the tests to be
+ // run
+ Set<String> connectorNames = new HashSet<>(Arrays.asList("MirrorSourceConnector",
+ "MirrorCheckpointConnector", "MirrorHeartbeatConnector"));
+
backup.configureConnector("MirrorSourceConnector", mm2Config.connectorBaseConfig(new SourceAndTarget("primary", "backup"),
MirrorSourceConnector.class));
@@ -163,6 +170,8 @@ public class MirrorConnectorsIntegrationTest {
backup.configureConnector("MirrorHeartbeatConnector", mm2Config.connectorBaseConfig(new SourceAndTarget("primary", "backup"),
MirrorHeartbeatConnector.class));
+ waitUntilMirrorMakerIsRunning(backup, connectorNames);
+
primary.configureConnector("MirrorSourceConnector", mm2Config.connectorBaseConfig(new SourceAndTarget("backup", "primary"),
MirrorSourceConnector.class));
@@ -199,7 +208,7 @@ public class MirrorConnectorsIntegrationTest {
}
@Test
- public void testReplication() throws InterruptedException, TimeoutException {
+ public void testReplication() throws InterruptedException {
MirrorClient primaryClient = new MirrorClient(mm2Config.clientConfig("primary"));
MirrorClient backupClient = new MirrorClient(mm2Config.clientConfig("backup"));