test(asset): add sleep retries to prevent RESOURCE_EXHAUSTED quota errors#4315
Open
angelcaamal wants to merge 6 commits into
Open
test(asset): add sleep retries to prevent RESOURCE_EXHAUSTED quota errors#4315angelcaamal wants to merge 6 commits into
angelcaamal wants to merge 6 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a retry mechanism with exponential backoff to the 'should list assets successfully' test in asset.test.js. The test now attempts to list assets up to three times, incorporating a sleep period that doubles with each retry to improve test stability. I have no feedback to provide as there were no review comments to evaluate.
…g policy tests to reduce API quota consumption and execution time.
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes Internal: b/514339354
This PR resolves the persistent CI/CD pipeline failures caused by the following gRPC error:
Error: 8 RESOURCE_EXHAUSTED: Quota exceeded for quota metric 'ListAssets Requests' and limit 'ListAssets Requests per minute' of service 'cloudasset.googleapis.com'The failure occurs because concurrent test executions within the shared Google Cloud project environment frequently exceed the organization's API rate limits.
Changes Made
waitMsdelay from 2 seconds to 60 seconds (1 minute) inside the test retry loop.Why a 1-Minute Initial Wait is Necessary
The
cloudasset.googleapis.comquota window resets on a per-minute basis. By introducing a full 60-second sleep before the very first execution attempt, we guarantee that the API's rate-limiting bucket has sufficient time to refresh and clear any traffic spikes caused by other concurrent pipelines. This prevents theRESOURCE_EXHAUSTEDerror from breaking the build and allows the test to proceed reliably.Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
npm test(see Testing)npm run lint(see Style)GoogleCloudPlatform/nodejs-docs-samples. Not a fork.