This is an automated email from the ASF dual-hosted git repository.
cegerton pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new ac2a642ba99 MINOR: Fix flaky test
ConnectWorkerIntegrationTest::testReconfigureConnectorWithFailingTaskConfigs
(#16273)
ac2a642ba99 is described below
commit ac2a642ba99cde8a398510ce5cf503462863b489
Author: Chris Egerton <[email protected]>
AuthorDate: Tue Jun 11 21:13:35 2024 +0200
MINOR: Fix flaky test
ConnectWorkerIntegrationTest::testReconfigureConnectorWithFailingTaskConfigs
(#16273)
Reviewers: Greg Harris <[email protected]>
---
.../kafka/connect/integration/ConnectWorkerIntegrationTest.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/connect/runtime/src/test/java/org/apache/kafka/connect/integration/ConnectWorkerIntegrationTest.java
b/connect/runtime/src/test/java/org/apache/kafka/connect/integration/ConnectWorkerIntegrationTest.java
index 83fce9231f7..c540016f104 100644
---
a/connect/runtime/src/test/java/org/apache/kafka/connect/integration/ConnectWorkerIntegrationTest.java
+++
b/connect/runtime/src/test/java/org/apache/kafka/connect/integration/ConnectWorkerIntegrationTest.java
@@ -1309,7 +1309,6 @@ public class ConnectWorkerIntegrationTest {
// since failure to reconfigure the tasks (which may occur if the bug
this test was written
// to help catch resurfaces) will not cause existing tasks to fail or
stop running
StartAndStopLatch restarts = connectorHandle.expectedStarts(1);
- connectorHandle.expectedCommits(NUM_TASKS * 2);
final String secondConnectorTopic = "connector-topic-2";
connect.kafka().createTopic(secondConnectorTopic, 1);
@@ -1323,6 +1322,9 @@ public class ConnectWorkerIntegrationTest {
"Connector tasks were not restarted in time",
restarts.await(10, TimeUnit.SECONDS)
);
+
+ // Wait for at least one task to commit offsets after being restarted
+ connectorHandle.expectedCommits(1);
connectorHandle.awaitCommits(offsetCommitIntervalMs * 3);
final long endOffset = connect.kafka().endOffset(new
TopicPartition(secondConnectorTopic, 0));