-
Notifications
You must be signed in to change notification settings - Fork 212
fix: Avoid redundant autoscaling start request #4683
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -152,8 +152,6 @@ func TestAccStreamProcessor_withOptionsDLQAutoscaling(t *testing.T) { | |
| ), | ||
| }, | ||
| { | ||
| // Starts a configured autoscaling processor through the top-level | ||
| // autoscaling field of the :startWith request. | ||
| Config: configWithOptionsDLQAutoscaling(t, projectID, workspaceName, clusterName, processorName, streamProcessorOptionsConfig{ | ||
| includeDLQ: true, | ||
| autoscalingMinTier: "SP10", | ||
|
|
@@ -198,6 +196,38 @@ func TestAccStreamProcessor_withOptionsDLQAutoscaling(t *testing.T) { | |
| }}) | ||
| } | ||
|
|
||
| func TestAccStreamProcessor_withOptionsDLQAutoscalingCreateStarted(t *testing.T) { | ||
| var ( | ||
| projectID, workspaceName = acc.ProjectIDExecutionWithStreamInstance(t) | ||
| _, clusterName = acc.ClusterNameExecution(t, false) | ||
| randomSuffix = acctest.RandString(5) | ||
|
Comment on lines
+199
to
+203
|
||
| processorName = "new-processor-autoscaling-started-" + randomSuffix | ||
| ) | ||
|
|
||
| resource.Test(t, resource.TestCase{ | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this tests the STARTED flow from the CREATE call which is not covered in the TestAccStreamProcessor_withOptionsDLQAutoscaling which calls the STARTED flow in the UPDATE call, which is why this was missed. This edge case bug only affected the from scratch |
||
| PreCheck: func() { acc.PreCheckBasic(t) }, | ||
| ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, | ||
| CheckDestroy: checkDestroyStreamProcessor, | ||
| Steps: []resource.TestStep{ | ||
| { | ||
| Config: configWithOptionsDLQAutoscaling(t, projectID, workspaceName, clusterName, processorName, streamProcessorOptionsConfig{ | ||
| includeDLQ: true, | ||
| autoscalingMinTier: "SP10", | ||
| autoscalingMaxTier: "SP50", | ||
| state: streamprocessor.StartedState, | ||
| }), | ||
| Check: resource.ComposeAggregateTestCheckFunc( | ||
| resource.TestCheckResourceAttrSet(resourceName, "id"), | ||
| resource.TestCheckResourceAttr(resourceName, "state", streamprocessor.StartedState), | ||
| resource.TestCheckResourceAttr(resourceName, "options.autoscaling.min_tier", "SP10"), | ||
| resource.TestCheckResourceAttr(resourceName, "options.autoscaling.max_tier", "SP50"), | ||
| resource.TestCheckResourceAttrSet(resourceName, "effective_tier"), | ||
| ), | ||
| }, | ||
| importStep(), | ||
| }}) | ||
| } | ||
|
|
||
| func basicTestCase(t *testing.T) *resource.TestCase { | ||
| t.Helper() | ||
| var ( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to understand, was this additional property simply redundant, or actually causing a failures? And what would be the change planned on the API side?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is redundant, but there appears to be a race condition with the service that the api calls when the autoscaling payload was included. I believe that this 404 returned in the endpoint call is a bug that we will fix. But it's good to also remove the redundant config and fix this error path in the meantime. My understanding that any payload sent the startsWithOptions in this flow will trigger this issue: here is the ticket filed