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: Use default timeouts for Fabric wait methods #631

Merged
merged 3 commits into from
Mar 29, 2024

Conversation

thogarty
Copy link
Contributor

  • All fabric resource wait methods have new argument for timeout
  • Using 30*time.Second to account for delay in wait methods
  • Timeout is for entire CRUD method so we subtract times as we go from the start of the method
  • Testing updated to account for changes

NOTE: We have errors running Fabric tests in parallel for now. Not sure of the issue, but this change has been testing manually locally with each test being run in an isolated manner. All tests are successful. Logs are too large to post.

@thogarty thogarty requested a review from a team as a code owner March 28, 2024 00:34
@codecov-commenter
Copy link

codecov-commenter commented Mar 28, 2024

Codecov Report

Attention: Patch coverage is 28.40909% with 63 lines in your changes are missing coverage. Please review.

Project coverage is 65.56%. Comparing base (42737f8) to head (2952d0b).

Files Patch % Lines
equinix/resource_fabric_connection.go 30.43% 15 Missing and 1 partial ⚠️
equinix/resource_fabric_routing_protocol.go 17.64% 14 Missing ⚠️
equinix/resource_fabric_cloud_router.go 35.29% 10 Missing and 1 partial ⚠️
equinix/resource_fabric_network.go 35.29% 10 Missing and 1 partial ⚠️
equinix/resource_fabric_service_profile.go 21.42% 11 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #631       +/-   ##
===========================================
+ Coverage   38.07%   65.56%   +27.49%     
===========================================
  Files         120      120               
  Lines       19393    19427       +34     
===========================================
+ Hits         7384    12738     +5354     
+ Misses      11801     6054     -5747     
- Partials      208      635      +427     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

fcr, _, err := client.CloudRoutersApi.CreateCloudRouter(ctx, createRequest)
if err != nil {
return diag.FromErr(equinix_errors.FormatFabricError(err))
}
d.SetId(fcr.Uuid)

if _, err = waitUntilCloudRouterIsProvisioned(d.Id(), meta, ctx); err != nil {
createTimeout := d.Timeout(schema.TimeoutCreate) - 30*time.Second - time.Since(start)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is 30s removed off the top of each timeout? Is this an off-by-one solution for catching the terminal 30s iteration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@displague , I had the same question when I first saw it. It's the pattern that Oscar shared when creating the issue: #627

I believe it's to counter the 30 Second time delay before the wait methods send their first polling request; the timeout then starts after that time delay. That's the understanding that I took from it being present.

Read: schema.DefaultTimeout(6 * time.Minute),
Create: schema.DefaultTimeout(15 * time.Minute),
Update: schema.DefaultTimeout(15 * time.Minute),
Delete: schema.DefaultTimeout(10 * time.Minute),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, can you make the delete timer 15 minutes as well? I was just about to create a PR for the same change. We had many issues with this today.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, no issues. Updating.

Copy link
Contributor

@srushti-patl srushti-patl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thogarty thogarty merged commit 5fa78b9 into main Mar 29, 2024
6 of 9 checks passed
@thogarty thogarty deleted the CXF-90520-fabric-resource-timeouts branch March 29, 2024 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants