-
Notifications
You must be signed in to change notification settings - Fork 203
fix: Fix acceptance tests and Delete for stream_instance acceptance tests #3447
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
base: master
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR fixes acceptance tests and improves deletion handling for stream_processor resources by waiting until the resource is fully deleted and reducing resource usage by switching to SP10.
- Adjusted timeouts (min timeout and delay) in the state transition wait function
- Updated acceptance tests to include a stream_config with SP10 tier
- Modified the Delete function to wait for the resource deletion status
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
internal/service/streamprocessor/state_transition.go | Updates timeout settings in the state transition function |
internal/service/streamprocessor/resource_test.go | Adds stream_config with tier "SP10" for tests |
internal/service/streamprocessor/resource.go | Improves Delete function by waiting for deletion transition |
internal/service/streamconnection/resource_stream_connection_test.go | Updates test configuration with stream_config (tier SP10) |
.changelog/3447.txt | Adds release note for the deletion fix |
Comments suppressed due to low confidence (1)
internal/service/streamprocessor/state_transition.go:35
- [nitpick] Consider updating or expanding the nearby comment to explain the rationale behind increasing the MinTimeout and setting a Delay of 10 seconds for better clarity on the new configuration.
MinTimeout: 10 * time.Second,
APIx bot: a message has been sent to Docs Slack channel |
MinTimeout: 3 * time.Second, | ||
Delay: 0, | ||
MinTimeout: 10 * time.Second, | ||
Delay: 10 * time.Second, |
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.
give some delay time to reduce flaky tests
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.
Adding 10 seconds to the delete operation of regular users for fixing our tests seems strange. Lets sync offline just to check if we can assess other options.
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.
sure, but I think this will also be helpful in Prod to fix a race condition in the API when it's under load
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.
Makes sense to me to add this 👍
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.
waiting for Atlas team to see if this is a good approach or they would fix it in their side
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.
LGTM
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.
Very nice
use of SP10 instead of SP30 moved to: #3453 |
This reverts commit 19b6aad.
@@ -0,0 +1,3 @@ | |||
```release-note:bug | |||
resource/mongodbatlas_stream_processor: Fixes Delete to wait until the resource is deleted |
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.
resource/mongodbatlas_stream_processor: Fixes Delete to wait until the resource is deleted | |
resource/mongodbatlas_stream_processor: Fixes Delete to wait until the resource is deleted. |
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.
@lmkerbey-mdb hi, we don't end changelogs with a period, see other examples in: https://github.com/mongodb/terraform-provider-mongodbatlas/tree/master/.changelog
so CHANGELOG is formed like this: https://github.com/mongodb/terraform-provider-mongodbatlas/blob/master/CHANGELOG.md
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.
LGTM once we get confirmation from streams team that delete is effectively a LRO which requires followup polling
resp.Diagnostics.AddError("error deleting resource", err.Error()) | ||
return | ||
} | ||
_, err := WaitStateTransition(ctx, params, connV2.StreamsApi, []string{InitiatingState, CreatingState, CreatedState, StartedState, StoppedState}, []string{DroppedState}) | ||
if apiError, _ := admin.AsError(err); apiError.GetError() == http.StatusBadRequest { |
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.
here we can check for BadRequest or NotFound (what would be the correct implementation) just to be future proof
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.
good idea, changed here: 2b47d75
Description
Fix acceptance tests and Delete for stream_processor acceptance tests.
Link to any related issue(s): CLOUDP-328093
Type of change:
Required Checklist:
Further comments