Skip to content

Commit

Permalink
fix(kafkatopic): acc tests but reverting performance fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-savciuc committed Sep 18, 2023
1 parent 7b54651 commit c147b86
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 2 additions & 3 deletions internal/sdkprovider/service/kafkatopic/kafka_topic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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`),
},
},
})
Expand Down
3 changes: 2 additions & 1 deletion internal/sdkprovider/service/kafkatopic/kafka_topic_wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...")
Expand All @@ -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
Expand Down

0 comments on commit c147b86

Please sign in to comment.