From c147b86b67ace5d12e083a3c34992171aab95008 Mon Sep 17 00:00:00 2001 From: Ivan Savciuc Date: Mon, 18 Sep 2023 14:30:59 +0200 Subject: [PATCH] fix(kafkatopic): acc tests but reverting performance fix --- CHANGELOG.md | 1 - internal/sdkprovider/service/kafkatopic/kafka_topic_test.go | 5 ++--- internal/sdkprovider/service/kafkatopic/kafka_topic_wait.go | 3 ++- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1544c2c4f..006688e1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,6 @@ nav_order: 1 - Fix `aiven_transit_gateway_vpc_attachment` resource update - Fix service IP filters normalization - Fix improper omitting in `ToAPI` -- Fix Kafka Topic perfomance - Add OpenSearch Security Plugin support (`aiven_opensearch_security_plugin_config` resource) - Deprecate `add_account_owners_admin_access` and `use_source_project_billing_group` fields in `aiven_project` resource diff --git a/internal/sdkprovider/service/kafkatopic/kafka_topic_test.go b/internal/sdkprovider/service/kafkatopic/kafka_topic_test.go index 4c79c7578..aaf57a5b1 100644 --- a/internal/sdkprovider/service/kafkatopic/kafka_topic_test.go +++ b/internal/sdkprovider/service/kafkatopic/kafka_topic_test.go @@ -397,8 +397,7 @@ func TestAccAivenKafkaTopic_recreate_missing(t *testing.T) { }, { // Step 3: recreates the topic - Config: config, - ExpectNonEmptyPlan: true, + Config: config, Check: resource.ComposeTestCheckFunc( // Saved in state resource.TestCheckResourceAttr(kafkaResource, "id", kafkaID), @@ -530,7 +529,7 @@ func TestAccAivenKafkaTopic_conflicts_if_exists(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccAivenKafkaTopicConflictsIfExists(prefix, project), - ExpectError: regexp.MustCompile(`Topic conflict already exists`), + ExpectError: regexp.MustCompile(`Topic conflict, already exists: conflict`), }, }, }) diff --git a/internal/sdkprovider/service/kafkatopic/kafka_topic_wait.go b/internal/sdkprovider/service/kafkatopic/kafka_topic_wait.go index 69cf055c1..fe9e8acaf 100644 --- a/internal/sdkprovider/service/kafkatopic/kafka_topic_wait.go +++ b/internal/sdkprovider/service/kafkatopic/kafka_topic_wait.go @@ -65,7 +65,6 @@ func (w *kafkaTopicAvailabilityWaiter) RefreshFunc() resource.StateRefreshFunc { func (w *kafkaTopicAvailabilityWaiter) refresh() error { c := getTopicCache() - c.AddToQueue(w.Project, w.ServiceName, w.TopicName) if !kafkaTopicAvailabilitySem.TryAcquire(1) { log.Printf("[TRACE] Kafka Topic Availability cache refresh already in progress ...") @@ -78,6 +77,8 @@ func (w *kafkaTopicAvailabilityWaiter) refresh() error { return nil } + c.AddToQueue(w.Project, w.ServiceName, w.TopicName) + queue := c.GetQueue(w.Project, w.ServiceName) if len(queue) == 0 { return nil