uros-b commented on code in PR #18322:
URL: https://github.com/apache/iceberg/pull/18322#discussion_r4143992107
##########
kafka-connect/kafka-connect/src/test/java/org/apache/iceberg/connect/channel/TestCoordinator.java:
##########
@@ -58,14 +60,30 @@
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableSet;
import org.apache.iceberg.relocated.com.google.common.collect.Lists;
import org.apache.iceberg.types.Types.StructType;
+import org.apache.kafka.clients.admin.MemberAssignment;
+import org.apache.kafka.clients.admin.MemberDescription;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.OffsetAndMetadata;
+import org.apache.kafka.common.ConsumerGroupState;
import org.apache.kafka.common.TopicPartition;
import org.apache.kafka.connect.sink.SinkTaskContext;
+import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class TestCoordinator extends ChannelTestBase {
+ @BeforeEach
+ void describeSourceAssignment() {
+ MemberDescription member =
+ new MemberDescription(
+ "member",
+ Optional.empty(),
+ "client",
+ "localhost",
+ new MemberAssignment(Set.of(new TopicPartition("topic", 1))));
Review Comment:
Fragile topic-name coupling in the test @BeforeEach.
TestCoordinator.describeSourceAssignment() stubs TopicPartition("topic", 1)
using a bare string literal — not the SRC_TOPIC_NAME constant used elsewhere.
The stub matches only because the existing TestCoordinator DataComplete events
also hardcode "topic". A natural refactor to SRC_TOPIC_NAME (or any constant
with a different value) would silently produce totalPartitionCount = 0, causing
the freshness check to reject every full commit in all existing tests with no
compile-time signal. The stub should reference the same constant as the
DataComplete events it is coupled to.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]