From 8ceb27167e41d8c329b35fdc0f380e9e810fb5c0 Mon Sep 17 00:00:00 2001 From: Yathi <511386+yuth@users.noreply.github.com> Date: Fri, 5 Mar 2021 12:20:41 -0800 Subject: [PATCH] fix(amplify-provider-awscloudformation): handle throttling Update stack event monitor to handle throttling errors when polling for stack events --- .circleci/config.yml | 64 +++++++++---------- .../stack-event-monitor.ts | 6 +- 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1010e4d8d7e..a5c818b4ae0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1025,37 +1025,37 @@ jobs: environment: TEST_SUITE: src/__tests__/plugin.test.ts CLI_REGION: ap-northeast-1 - migration-node-function-amplify_e2e_tests: + schema-iterative-update-locking-amplify_e2e_tests: working_directory: ~/repo docker: *ref_0 resource_class: large steps: *ref_3 environment: - TEST_SUITE: src/__tests__/migration/node.function.test.ts + TEST_SUITE: src/__tests__/schema-iterative-update-locking.test.ts CLI_REGION: ap-southeast-1 - api_4-amplify_e2e_tests: + migration-node-function-amplify_e2e_tests: working_directory: ~/repo docker: *ref_0 resource_class: large steps: *ref_3 environment: - TEST_SUITE: src/__tests__/api_4.test.ts + TEST_SUITE: src/__tests__/migration/node.function.test.ts CLI_REGION: ap-southeast-2 - schema-iterative-update-locking-amplify_e2e_tests: + function_5-amplify_e2e_tests: working_directory: ~/repo docker: *ref_0 resource_class: large steps: *ref_3 environment: - TEST_SUITE: src/__tests__/schema-iterative-update-locking.test.ts + TEST_SUITE: src/__tests__/function_5.test.ts CLI_REGION: us-east-2 - function_5-amplify_e2e_tests: + api_4-amplify_e2e_tests: working_directory: ~/repo docker: *ref_0 resource_class: large steps: *ref_3 environment: - TEST_SUITE: src/__tests__/function_5.test.ts + TEST_SUITE: src/__tests__/api_4.test.ts CLI_REGION: us-west-2 schema-iterative-update-4-amplify_e2e_tests_pkg_linux: working_directory: ~/repo @@ -1667,44 +1667,44 @@ jobs: TEST_SUITE: src/__tests__/plugin.test.ts CLI_REGION: ap-northeast-1 steps: *ref_4 - migration-node-function-amplify_e2e_tests_pkg_linux: + schema-iterative-update-locking-amplify_e2e_tests_pkg_linux: working_directory: ~/repo docker: *ref_0 resource_class: large environment: AMPLIFY_DIR: /home/circleci/repo/out AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux - TEST_SUITE: src/__tests__/migration/node.function.test.ts + TEST_SUITE: src/__tests__/schema-iterative-update-locking.test.ts CLI_REGION: ap-southeast-1 steps: *ref_4 - api_4-amplify_e2e_tests_pkg_linux: + migration-node-function-amplify_e2e_tests_pkg_linux: working_directory: ~/repo docker: *ref_0 resource_class: large environment: AMPLIFY_DIR: /home/circleci/repo/out AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux - TEST_SUITE: src/__tests__/api_4.test.ts + TEST_SUITE: src/__tests__/migration/node.function.test.ts CLI_REGION: ap-southeast-2 steps: *ref_4 - schema-iterative-update-locking-amplify_e2e_tests_pkg_linux: + function_5-amplify_e2e_tests_pkg_linux: working_directory: ~/repo docker: *ref_0 resource_class: large environment: AMPLIFY_DIR: /home/circleci/repo/out AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux - TEST_SUITE: src/__tests__/schema-iterative-update-locking.test.ts + TEST_SUITE: src/__tests__/function_5.test.ts CLI_REGION: us-east-2 steps: *ref_4 - function_5-amplify_e2e_tests_pkg_linux: + api_4-amplify_e2e_tests_pkg_linux: working_directory: ~/repo docker: *ref_0 resource_class: large environment: AMPLIFY_DIR: /home/circleci/repo/out AMPLIFY_PATH: /home/circleci/repo/out/amplify-pkg-linux - TEST_SUITE: src/__tests__/function_5.test.ts + TEST_SUITE: src/__tests__/api_4.test.ts CLI_REGION: us-west-2 steps: *ref_4 workflows: @@ -1792,11 +1792,11 @@ workflows: - hostingPROD-amplify_e2e_tests - amplify-app-amplify_e2e_tests - init-amplify_e2e_tests - - schema-iterative-update-locking-amplify_e2e_tests + - function_5-amplify_e2e_tests - predictions-amplify_e2e_tests - schema-predictions-amplify_e2e_tests - amplify-configure-amplify_e2e_tests - - function_5-amplify_e2e_tests + - api_4-amplify_e2e_tests - function_3-amplify_e2e_tests - containers-api-amplify_e2e_tests - interactions-amplify_e2e_tests @@ -1812,22 +1812,22 @@ workflows: - schema-key-amplify_e2e_tests - analytics-amplify_e2e_tests - notifications-amplify_e2e_tests - - migration-node-function-amplify_e2e_tests + - schema-iterative-update-locking-amplify_e2e_tests - schema-auth-10-amplify_e2e_tests - hosting-amplify_e2e_tests - tags-amplify_e2e_tests - - api_4-amplify_e2e_tests + - migration-node-function-amplify_e2e_tests - done_with_pkg_linux_e2e_tests: context: amplify-cli-ecr requires: - hostingPROD-amplify_e2e_tests_pkg_linux - amplify-app-amplify_e2e_tests_pkg_linux - init-amplify_e2e_tests_pkg_linux - - schema-iterative-update-locking-amplify_e2e_tests_pkg_linux + - function_5-amplify_e2e_tests_pkg_linux - predictions-amplify_e2e_tests_pkg_linux - schema-predictions-amplify_e2e_tests_pkg_linux - amplify-configure-amplify_e2e_tests_pkg_linux - - function_5-amplify_e2e_tests_pkg_linux + - api_4-amplify_e2e_tests_pkg_linux - function_3-amplify_e2e_tests_pkg_linux - containers-api-amplify_e2e_tests_pkg_linux - interactions-amplify_e2e_tests_pkg_linux @@ -1843,11 +1843,11 @@ workflows: - schema-key-amplify_e2e_tests_pkg_linux - analytics-amplify_e2e_tests_pkg_linux - notifications-amplify_e2e_tests_pkg_linux - - migration-node-function-amplify_e2e_tests_pkg_linux + - schema-iterative-update-locking-amplify_e2e_tests_pkg_linux - schema-auth-10-amplify_e2e_tests_pkg_linux - hosting-amplify_e2e_tests_pkg_linux - tags-amplify_e2e_tests_pkg_linux - - api_4-amplify_e2e_tests_pkg_linux + - migration-node-function-amplify_e2e_tests_pkg_linux - amplify_migration_tests_latest: context: amplify-cli-ecr filters: @@ -1978,7 +1978,7 @@ workflows: filters: *ref_5 requires: - schema-auth-7-amplify_e2e_tests - - schema-iterative-update-locking-amplify_e2e_tests: + - function_5-amplify_e2e_tests: context: amplify-cli-ecr filters: *ref_5 requires: @@ -2028,7 +2028,7 @@ workflows: filters: *ref_5 requires: - auth_4-amplify_e2e_tests - - function_5-amplify_e2e_tests: + - api_4-amplify_e2e_tests: context: amplify-cli-ecr filters: *ref_5 requires: @@ -2208,7 +2208,7 @@ workflows: filters: *ref_5 requires: - schema-searchable-amplify_e2e_tests - - migration-node-function-amplify_e2e_tests: + - schema-iterative-update-locking-amplify_e2e_tests: context: amplify-cli-ecr filters: *ref_5 requires: @@ -2253,7 +2253,7 @@ workflows: filters: *ref_5 requires: - schema-auth-8-amplify_e2e_tests - - api_4-amplify_e2e_tests: + - migration-node-function-amplify_e2e_tests: context: amplify-cli-ecr filters: *ref_5 requires: @@ -2310,7 +2310,7 @@ workflows: filters: *ref_6 requires: - schema-auth-7-amplify_e2e_tests_pkg_linux - - schema-iterative-update-locking-amplify_e2e_tests_pkg_linux: + - function_5-amplify_e2e_tests_pkg_linux: context: amplify-cli-ecr filters: *ref_6 requires: @@ -2364,7 +2364,7 @@ workflows: filters: *ref_6 requires: - auth_4-amplify_e2e_tests_pkg_linux - - function_5-amplify_e2e_tests_pkg_linux: + - api_4-amplify_e2e_tests_pkg_linux: context: amplify-cli-ecr filters: *ref_6 requires: @@ -2560,7 +2560,7 @@ workflows: filters: *ref_6 requires: - schema-searchable-amplify_e2e_tests_pkg_linux - - migration-node-function-amplify_e2e_tests_pkg_linux: + - schema-iterative-update-locking-amplify_e2e_tests_pkg_linux: context: amplify-cli-ecr filters: *ref_6 requires: @@ -2609,7 +2609,7 @@ workflows: filters: *ref_6 requires: - schema-auth-8-amplify_e2e_tests_pkg_linux - - api_4-amplify_e2e_tests_pkg_linux: + - migration-node-function-amplify_e2e_tests_pkg_linux: context: amplify-cli-ecr filters: *ref_6 requires: diff --git a/packages/amplify-provider-awscloudformation/src/iterative-deployment/stack-event-monitor.ts b/packages/amplify-provider-awscloudformation/src/iterative-deployment/stack-event-monitor.ts index 18239b3bdf8..8f1e3cca989 100644 --- a/packages/amplify-provider-awscloudformation/src/iterative-deployment/stack-event-monitor.ts +++ b/packages/amplify-provider-awscloudformation/src/iterative-deployment/stack-event-monitor.ts @@ -139,7 +139,11 @@ export class StackEventMonitor { if (e.code === 'ValidationError' && e.message === `Stack [${this.stackName}] does not exist`) { return; } - throw e; + if (e.code === 'Throttling') { + // ignore throttling error + } else { + throw e; + } } events.reverse();