-
Notifications
You must be signed in to change notification settings - Fork 488
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(sam): slow SamCliLocalInvokeInvocation, ChildProcess tests #5964
## Problem - The test failure is due to timeout on Windows when first searching for the SAM cli path in `src/shared/sam/cli/samCliLocator.ts`. This is a known slow process. - The verification of SAM is also slow (100-200ms), even if result is cached and we do this each time we read from cache. ## Solution - Verify the cache once, rather than on each read. - Find sam cli in the before hook to allow all sam tests to run under same conditions. Otherwise, the first test is then responsible for actually finding the path causing it to take way longer than the rest of the tests. - Allow 3x retries on before hook on windows to avoid flakiness. ## Notes - An alternative solution could involve manually inserting into the cache, or mocking a piece of the component, but wanted to keep the test coverage as is. - This approach also allows us to isolate the finding code into its own test (rather than whatever the first test is) to see if there are performance regressions. - Additionally, retry mechanism was more effective than increasing the timeout in reducing flakiness.
- Loading branch information
1 parent
0abac1f
commit 1153658
Showing
4 changed files
with
28 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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