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

tests: simple backoff on direct dynamic #3172

Conversation

acpana
Copy link
Collaborator

@acpana acpana commented Nov 13, 2024

Going off of #3162 , let's add a simple exp backoff to the delete. The underlying 1P API calls may benefit from this. Ideally we'd get the retries for free from the testing framework but starting off here for now.

if err == nil && found {
op := directbase.NewDeleteOperation(c, u)
_, err = a.Delete(ctx, op)
if err == nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it possible that err != nil but the deletion is still completed? I remember some resources may return an error during creation but still create the resource.

In that case we'll get err == nil && !found, and return an error in the second iteration, right? So maybe let only do err == nil && !found check for the first iteration?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh interesting I didn't know that -- I can adjust the code to function like that!

Copy link
Collaborator

Choose a reason for hiding this comment

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

It may not be a common case. But I think NotFound in general can be considered fine when the resource was found in the first deletion.

Copy link
Collaborator

@maqiuyujoyce maqiuyujoyce left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maqiuyujoyce

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit 2656148 into GoogleCloudPlatform:master Nov 14, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants