From 68952cc028bfdb58cbbbd6bc71b25d5e1303262a Mon Sep 17 00:00:00 2001 From: Dhruv Jauhar Date: Mon, 12 Jul 2021 09:30:50 -0400 Subject: [PATCH 1/5] Bump confluentPlatformVersion from 6.1.1 to 6.2.0 --- functional_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functional_test.go b/functional_test.go index 95bffb964..4c355bb0b 100644 --- a/functional_test.go +++ b/functional_test.go @@ -121,7 +121,7 @@ func prepareDockerTestEnvironment(ctx context.Context, env *testEnvironment) err var confluentPlatformVersion string switch env.KafkaVersion { case "2.8.0": - confluentPlatformVersion = "6.1.1" + confluentPlatformVersion = "6.2.0" case "2.7.1": confluentPlatformVersion = "6.1.1" default: From 9a79f244b180cf217ecb2fa732d4ef9dc0759f97 Mon Sep 17 00:00:00 2001 From: Dhruv Jauhar Date: Wed, 8 Sep 2021 08:44:43 -0400 Subject: [PATCH 2/5] check against ErrInvalidTopic as well --- functional_producer_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functional_producer_test.go b/functional_producer_test.go index 63bf02110..d69b4cd58 100644 --- a/functional_producer_test.go +++ b/functional_producer_test.go @@ -101,7 +101,7 @@ func TestFuncProducingToInvalidTopic(t *testing.T) { t.Error("Expected ErrUnknownTopicOrPartition, found", err) } - if _, _, err := producer.SendMessage(&ProducerMessage{Topic: "in/valid"}); err != ErrUnknownTopicOrPartition { + if _, _, err := producer.SendMessage(&ProducerMessage{Topic: "in/valid"}); err != ErrUnknownTopicOrPartition || err != ErrInvalidTopic { t.Error("Expected ErrUnknownTopicOrPartition, found", err) } From ce4d8e10e4333357cfa7d9051c059010f5320dd3 Mon Sep 17 00:00:00 2001 From: Vlad Gorodetsky Date: Thu, 9 Sep 2021 11:43:54 +0300 Subject: [PATCH 3/5] Fix err check, use 6.2.0 in docker-compose too --- docker-compose.yml | 16 ++++++++-------- functional_producer_test.go | 6 +----- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 8e9c24e3d..db22182a0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.7' services: zookeeper-1: - image: 'confluentinc/cp-zookeeper:${CONFLUENT_PLATFORM_VERSION:-6.1.1}' + image: 'confluentinc/cp-zookeeper:${CONFLUENT_PLATFORM_VERSION:-6.2.0}' restart: always environment: ZOOKEEPER_SERVER_ID: '1' @@ -13,7 +13,7 @@ services: ZOOKEEPER_SYNC_LIMIT: '5' ZOOKEEPER_MAX_CLIENT_CONNS: '0' zookeeper-2: - image: 'confluentinc/cp-zookeeper:${CONFLUENT_PLATFORM_VERSION:-6.1.1}' + image: 'confluentinc/cp-zookeeper:${CONFLUENT_PLATFORM_VERSION:-6.2.0}' restart: always environment: ZOOKEEPER_SERVER_ID: '2' @@ -25,7 +25,7 @@ services: ZOOKEEPER_SYNC_LIMIT: '5' ZOOKEEPER_MAX_CLIENT_CONNS: '0' zookeeper-3: - image: 'confluentinc/cp-zookeeper:${CONFLUENT_PLATFORM_VERSION:-6.1.1}' + image: 'confluentinc/cp-zookeeper:${CONFLUENT_PLATFORM_VERSION:-6.2.0}' restart: always environment: ZOOKEEPER_SERVER_ID: '3' @@ -37,7 +37,7 @@ services: ZOOKEEPER_SYNC_LIMIT: '5' ZOOKEEPER_MAX_CLIENT_CONNS: '0' kafka-1: - image: 'confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION:-6.1.1}' + image: 'confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION:-6.2.0}' restart: always environment: KAFKA_ZOOKEEPER_CONNECT: 'zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181' @@ -54,7 +54,7 @@ services: KAFKA_DELETE_TOPIC_ENABLE: 'true' KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'false' kafka-2: - image: 'confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION:-6.1.1}' + image: 'confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION:-6.2.0}' restart: always environment: KAFKA_ZOOKEEPER_CONNECT: 'zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181' @@ -71,7 +71,7 @@ services: KAFKA_DELETE_TOPIC_ENABLE: 'true' KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'false' kafka-3: - image: 'confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION:-6.1.1}' + image: 'confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION:-6.2.0}' restart: always environment: KAFKA_ZOOKEEPER_CONNECT: 'zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181' @@ -88,7 +88,7 @@ services: KAFKA_DELETE_TOPIC_ENABLE: 'true' KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'false' kafka-4: - image: 'confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION:-6.1.1}' + image: 'confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION:-6.2.0}' restart: always environment: KAFKA_ZOOKEEPER_CONNECT: 'zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181' @@ -105,7 +105,7 @@ services: KAFKA_DELETE_TOPIC_ENABLE: 'true' KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'false' kafka-5: - image: 'confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION:-6.1.1}' + image: 'confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION:-6.2.0}' restart: always environment: KAFKA_ZOOKEEPER_CONNECT: 'zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181' diff --git a/functional_producer_test.go b/functional_producer_test.go index d69b4cd58..ebfeccb71 100644 --- a/functional_producer_test.go +++ b/functional_producer_test.go @@ -97,11 +97,7 @@ func TestFuncProducingToInvalidTopic(t *testing.T) { t.Fatal(err) } - if _, _, err := producer.SendMessage(&ProducerMessage{Topic: "in/valid"}); err != ErrUnknownTopicOrPartition { - t.Error("Expected ErrUnknownTopicOrPartition, found", err) - } - - if _, _, err := producer.SendMessage(&ProducerMessage{Topic: "in/valid"}); err != ErrUnknownTopicOrPartition || err != ErrInvalidTopic { + if _, _, err := producer.SendMessage(&ProducerMessage{Topic: "in/valid"}); err != ErrUnknownTopicOrPartition && err != ErrInvalidTopic { t.Error("Expected ErrUnknownTopicOrPartition, found", err) } From 2bb5560cbd2d08566564c06b4e9b5459bd0cd0be Mon Sep 17 00:00:00 2001 From: Dominic Evans Date: Mon, 13 Sep 2021 12:02:14 +0100 Subject: [PATCH 4/5] chore: upgrade to kafka 2.7.1 branch to cp-6.1.2 Whilst this isn't a new kafka version, it does bundle a number of fixes that are probably worth tracking, so bump up to it. https://docs.confluent.io/platform/6.1.2/release-notes/changelog.html --- functional_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functional_test.go b/functional_test.go index 4c355bb0b..f13703edf 100644 --- a/functional_test.go +++ b/functional_test.go @@ -112,7 +112,7 @@ func prepareDockerTestEnvironment(ctx context.Context, env *testEnvironment) err if version, ok := os.LookupEnv("KAFKA_VERSION"); ok { env.KafkaVersion = version } else { - // We have cp-6.1.1 as the default in the docker-compose file, so that's kafka 2.7.1. + // We have cp-6.1.2 as the default in the docker-compose file, so that's kafka 2.7.1. env.KafkaVersion = "2.7.1" } @@ -123,7 +123,7 @@ func prepareDockerTestEnvironment(ctx context.Context, env *testEnvironment) err case "2.8.0": confluentPlatformVersion = "6.2.0" case "2.7.1": - confluentPlatformVersion = "6.1.1" + confluentPlatformVersion = "6.1.2" default: return fmt.Errorf("don't know what confluent platform version to use for kafka %s", env.KafkaVersion) } From fc819da7e763f6660cdab9fbc87337705091ec94 Mon Sep 17 00:00:00 2001 From: Dominic Evans Date: Mon, 13 Sep 2021 12:59:17 +0100 Subject: [PATCH 5/5] fix(test): account for another 2.8.0 InvalidTopic In Kafka 2.8.0 there is a specific ErrInvalidTopic error response so allow for that in the functional_client_test.go --- functional_client_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functional_client_test.go b/functional_client_test.go index 949508c75..0cf8c35b4 100644 --- a/functional_client_test.go +++ b/functional_client_test.go @@ -45,8 +45,8 @@ func TestFuncClientMetadata(t *testing.T) { t.Error("Expected ErrUnknownTopicOrPartition, got", err) } - if _, err := client.Replicas("invalid/topic", 0); err != ErrUnknownTopicOrPartition { - t.Error("Expected ErrUnknownTopicOrPartition, got", err) + if _, err := client.Replicas("invalid/topic", 0); err != ErrUnknownTopicOrPartition && err != ErrInvalidTopic { + t.Error("Expected ErrUnknownTopicOrPartition or ErrInvalidTopic, got", err) } partitions, err := client.Partitions("test.4")