diff --git a/packages/aws-cdk/test/api/hotswap/appsync-mapping-templates-hotswap-deployments.test.ts b/packages/aws-cdk/test/api/hotswap/appsync-mapping-templates-hotswap-deployments.test.ts index 46e03cc88aba2..f4c89d634f99f 100644 --- a/packages/aws-cdk/test/api/hotswap/appsync-mapping-templates-hotswap-deployments.test.ts +++ b/packages/aws-cdk/test/api/hotswap/appsync-mapping-templates-hotswap-deployments.test.ts @@ -1045,8 +1045,13 @@ describe.each([HotswapMode.FALL_BACK, HotswapMode.HOTSWAP_ONLY])('%p mode', (hot ); silentTest( - 'updateFunction() API fails if it recieves 7 failed attempts in a row - this is a long running test', + 'updateFunction() API fails if it recieves 7 failed attempts in a row', async () => { + // Ignore the wait times that the SDK tries to impose and always set timers for 1 ms + const realSetTimeout = setTimeout; + const mockSetTimeout = jest.spyOn(global, 'setTimeout').mockImplementation((fn) => { + return realSetTimeout(fn, 1); + }); // GIVEN mockAppSyncClient @@ -1123,6 +1128,8 @@ describe.each([HotswapMode.FALL_BACK, HotswapMode.HOTSWAP_ONLY])('%p mode', (hot requestMappingTemplate: '## original request template', responseMappingTemplate: '## new response template', }); + + mockSetTimeout.mockRestore(); }, 320000, );