Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(kafkatopic): acc tests but reverting performance fix #1361

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Loading