Skip to content

Flaky test in run/django #5307

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

Closed
tmatsuo opened this issue Jan 29, 2021 · 7 comments · Fixed by #5368
Closed

Flaky test in run/django #5307

tmatsuo opened this issue Jan 29, 2021 · 7 comments · Fixed by #5368
Assignees
Labels
api: run Issues related to the Cloud Run API. priority: p2 Moderately-important priority. Fix may not be included in next release. samples Issues that are directly related to samples. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@tmatsuo
Copy link
Contributor

tmatsuo commented Jan 29, 2021

an example build

@tmatsuo tmatsuo added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. api: run Issues related to the Cloud Run API. labels Jan 29, 2021
@tmatsuo tmatsuo self-assigned this Jan 29, 2021
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Jan 29, 2021
@tmatsuo
Copy link
Contributor Author

tmatsuo commented Jan 29, 2021

It fails in teardown. I think the relevant message is ERROR: (gcloud.sql.databases.delete) HTTPError 409: Operation failed because another operation was already in progress.

@tmatsuo
Copy link
Contributor Author

tmatsuo commented Jan 29, 2021

Here is my guess what's happening.

  1. gcloud sql databases delete command send an underlining api request
  2. the request errored (probably timeout), but the server got the request and processing
  3. gcloud automatically retry the request
  4. the server returns 409 because it is processing the previous request
  5. gcloud reports the error

I think it's worth reporting to upstream.

FYI @dinagraves

@leahecole
Copy link
Collaborator

Added @glasnt also who is the original author of this sample

@glasnt
Copy link
Contributor

glasnt commented Feb 3, 2021

I think this sample would benefit from moving to the "setup/cleanup/retry.sh" method of setting up and taking down testing infra (borrowed from node.js, being used in an upcoming sample)

@glasnt
Copy link
Contributor

glasnt commented Feb 11, 2021

#5340 is now merged, should fix this issue

@leahecole
Copy link
Collaborator

I am seeing that some storage buckets aren't being deleted - could that be an oversight in this refactor?

@glasnt
Copy link
Contributor

glasnt commented Feb 14, 2021

Good catch, @leahecole; I'll clean that up and submit a PR fix.

gcf-merge-on-green bot pushed a commit that referenced this issue Feb 18, 2021
## Description

Fixes #5307 

Note: It's a good idea to open an issue first for discussion.

## Checklist
- [ ] I have followed [Sample Guidelines from AUTHORING_GUIDE.MD](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md)
- [ ] README is updated to include [all relevant information](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md#readme-file)
- [ ] **Tests** pass:   `nox -s py-3.6` (see [Test Environment Setup](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md#test-environment-setup))
- [ ] **Lint** pass:   `nox -s lint` (see [Test Environment Setup](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md#test-environment-setup))
- [ ] These samples need a new **API enabled** in testing projects to pass (let us know which ones)
- [ ] These samples need a new/updated **env vars** in testing projects set to pass (let us know which ones)
- [ ] Please **merge** this PR for me once it is approved.
- [ ] This sample adds a new sample directory, and I updated the [CODEOWNERS file](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/.github/CODEOWNERS) with the codeowners for this sample
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: run Issues related to the Cloud Run API. priority: p2 Moderately-important priority. Fix may not be included in next release. samples Issues that are directly related to samples. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants