99from containerized_test_runner .models import Request , ConcurrentTest
1010
1111HANDLER = "basic-lambda-concurrent"
12+ INVOCATION_ID_HANDLER = "invocation-id-concurrent"
1213IMAGE = os .environ .get ("TEST_IMAGE" , "local/test-base" )
14+ SAME_REQUEST_ID = "shared-request-id"
1315DEFAULT_CONCURRENCY = 10
1416TIMEOUT = 5
1517
@@ -23,7 +25,7 @@ def _make_env(concurrency: int = DEFAULT_CONCURRENCY) -> dict:
2325
2426
2527def _invocation_id_env (concurrency : int = DEFAULT_CONCURRENCY , timeout : int = TIMEOUT ) -> dict :
26- return _make_env | {
28+ return _make_env ( concurrency ) | {
2729 "AWS_LAMBDA_FUNCTION_TIMEOUT" : str (timeout ),
2830 }
2931
@@ -71,25 +73,25 @@ def get_concurrent_scenarios():
7173 return scenarios
7274
7375
74- def invocation_id_scenarios ():
76+ def get_invocation_id_scenarios ():
7577 batches = [
7678 [Request .create (
77- payload = {"name " : "invoke-A" , "sleep" : TIMEOUT + 2 },
79+ payload = {"command " : "invoke-A" , "sleep" : TIMEOUT + 2 },
7880 assertions = [{"transform" : ".errorType" , "error" : "Sandbox.Timedout" }],
7981 headers = {"X-Amzn-RequestId" : SAME_REQUEST_ID },
8082 )],
8183 [Request .create (
82- payload = {"name " : "invoke-B" , "sleep" : TIMEOUT - 1 },
83- assertions = { "response " : { "from" : "invoke-B" }} ,
84+ payload = {"command " : "invoke-B" , "sleep" : TIMEOUT - 1 },
85+ assertions = [{ "transform " : ".req_id" , "response" : SAME_REQUEST_ID }] ,
8486 headers = {"X-Amzn-RequestId" : SAME_REQUEST_ID },
8587 )],
8688 ]
8789
8890
8991 return [ConcurrentTest (
9092 name = "invocation_id" ,
91- handler = "invocation-id-concurrent" ,
92- environment_variables = _invocation_id_env (timeout = 1 ),
93+ handler = INVOCATION_ID_HANDLER ,
94+ environment_variables = _invocation_id_env (timeout = TIMEOUT ),
9395 request_batches = batches ,
9496 image = IMAGE ,
9597 )]
0 commit comments