fix(aws-lambda): wait a little longer for the lambda when using a VPC #2778
+5
−2
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
When using the aws-lambda platform for running tests and using a VPC, it often takes a little longer for the function to become ready that it does when creating the lambda without a VPC. When the lambda doesn't get created in time that leaves things in an inconsistent state, as the lambda is also never cleaned up. To avoid changing the behaviour when not using a VPC, this change adds a check before starting the wait for lambda flow. If the lambda is going to be connected to a VPC it sets the wait timeout to 4 minutes, otherwise it sets it to the current value of 2 minutes.
This issue happens fairly regularly, the effect being a failed test run:

and an orphaned lambda floating in the aws account:

I'm afraid I didn't open an issue first (or write tests) since the change is extremely trivial, but lmk if you think it warrants writing tests.
Pre-merge checklist
This is for use by the Artillery team. Please leave this in if you're contributing to Artillery.