Repository navigation
test(telemetry): give asserted destroys time to finish throttle retries - #1292
Merged
Merged
Conversation
The sandbox:destroy and destroy SUCCESS cases gave the command 450 s. When API Gateway throttles DeleteRestApi (429), one throttled cdk destroy attempt on this app's stack takes about 5 min. So the test killed the command during its first retry, before trackCommand wrote the event, and the case failed with "telemetry file not written. exit=null" even though the destroy was healthy. Give those two destroys 20 min. With ~5-min attempts that covers the first attempt and two throttle retries in core's runDestroyWithRetries (waits of at most 1 and 2 min). Raise the suite timeout, the runner's cancellation threshold, from 40 to 50 min so one destroy in the sandbox group can use the whole limit. Throttled destroys of this app's stack that finished in CI's cleanup step took 4.5 to 21 min, most under 12. This does not cover every retry core may make. Core schedules no further throttle retry whose wait would end more than 20 min after the first failure, but the last retry can finish after that, and core sets no hard limit on the total time. The job's AWS session from configure-aws-credentials lasts 1 h, and the sandbox group runs three destroys in a row, so the suite has to end well within that. The job's timeout-minutes (60) is unchanged. Cleanup destroys that only remove a case's stack keep 450 s; the job's Cleanup stacks step retries what they leave, best-effort, in whatever job time is left.
|
sharonyajain
approved these changes
Nov 4, 2026
harsh62
added a commit
that referenced
this pull request
Nov 4, 2026
Brings in the blocks CLI (#1203), CLI-calling templates (#1207), AuthBasic sign-in metrics (#1296), docs corrections (#1288), the native export type-name rule (#1134), the consolidated Data block bb-database (#774), CI checkout of the PR merge commit (#1291) and smaller fixes (#960, #1292, #1294). Conflict resolutions: - packages/bb-auth-basic, bb-auth-cognito/DESIGN.md, bb-auth-oidc: kept deleted. #1288's cookie correction already holds in Auth's DESIGN.md; #1203's `cdk-blocks secret` wording has no Auth counterpart (Auth's README uses `npm run secret`). #1296's metrics are not ported here (see the follow-up and the pending-changes note). - Changesets naming deleted packages: auth-basic-signin-metrics and bb-auth-oidc-cdk-blocks-secret removed and folded into auth-replaced-blocks-pending-changes.md; docs-correct-infra-guidance drops bb-auth-cognito. - templates/auth-cognito: not re-added (its e2e test is git rm'd). templates/auth/aws-blocks/scripts/*: deleted, as #1207 deleted them from every template; auth's package.json, README and gitignore auto-merged onto the cdk-blocks scripts. - templates/default and react e2e tests: kept this branch's Auth sign-up-with-code flow and its per-run username, plus main's package.json port lookup and graceful server shutdown. - create-blocks-app cli.test.ts: main's per-template tables name `auth`, not `auth-cognito`. - package.json workspaces: bb-database added, old auth packages stay removed, bb-auth kept. packages/blocks/package.json: main's cdk-blocks bin, tsx dependency and cli tests, plus this branch's test files. package-lock.json regenerated with `npm install --package-lock-only`, keeping main's @aws/dsql-lint 0.2.20. - docs/DECISIONS.md: both sides kept. main's D-021 (export type names) keeps its number; the auth decision becomes D-022, and every link to it is updated. D-008's reference keeps the bb-auth path, without the PR numbers #1288 removed. - native fixture 27 dart/client.dart: regenerated with regenerate-all.sh; the drift is #1134's APILink plus this branch's positional params. - bb-database README quick start: Auth from @aws-blocks/bb-auth instead of AuthBasic.
2 of 3 tasks
This branch was previously deployed
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.
Problem
Telemetry E2E fails intermittently in
SUCCESS: sandbox:destroy after deploy emits sandbox:destroy/SUCCESSandSUCCESS: destroy with creds emits destroy/SUCCESSwith:The stdout tail shows the destroy still retrying, for example
⏳ Stack deletion was throttled by AWS (API rate limit). Retrying in 41s (throttle retry 1; backing off for up to 20 min)...or⏳ Stack deletion failed. Retrying in 60s (waiting for resource cleanup)..., withToo Many Requests (Service: ApiGateway, Status Code: 429 ...)on stderr. The test gives each destroy 450 s, but a throttledcdk destroyattempt on this app's stack takes about 5 min, so the test stops the command during its first retry, beforetrackCommandwrites the event.Issue #, if available:
Changes
DESTROY_TIMEOUT_MS). With attempts of about 5 min, that covers the first attempt and two throttle retries in core'srunDestroyWithRetries(jittered waits of at most 1 and 2 min). In CI's cleanup step, throttled destroys of this stack that recovered took 4.5 to 21 min, most under 12.SUITE_TIMEOUT_MS). The sandbox group is the longer AWS group and takes 10 to 21 min when it passes, so this leaves room for one of its destroys to use the full 20 min. The groups run concurrently, and destroys within a group run in sequence.e2e-telemetryjob'stimeout-minutes: 60, core's retry behavior, and the cleanup destroys that only remove a case's stack. Those keep 450 s, and the job's "Cleanup stacks" step retries any stack they leave, best-effort, in whatever job time is left.Trade-off: this covers realistic throttling, not every retry core may make. Core stops scheduling throttle retries once a wait would end more than 20 min after the first failure, but the last retry can finish after that, and core sets no hard limit on the total time. The job's AWS session from
configure-aws-credentialslasts 1 h, and the sandbox group runs three destroys in a row, so the suite has to end well within that session. The comments on the two constants explain both budgets.Validation
npm run build,npm run lint,npm run lint:depsandnpx tsc --noEmit -p test-apps/telemetrypass.npm test(every workspace) andnpm run test:e2e:localpass with 0 failures.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.