Skip to content

Commit a8bf883

Browse files
committed
chore: more fixes
1 parent ca598ac commit a8bf883

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

examples/basic-lambda-concurrent/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ async fn main() -> Result<(), Error> {
2727
// required to enable CloudWatch error logging by the runtime
2828
tracing::init_default_subscriber();
2929

30+
let max_concurrency = std::env::var("AWS_LAMBDA_MAX_CONCURRENCY").unwrap_or_else(|_| "not set".to_string());
31+
tracing::info!(AWS_LAMBDA_MAX_CONCURRENCY = %max_concurrency, "starting concurrent handler");
32+
3033
let func = service_fn(my_handler);
3134
if let Err(err) = lambda_runtime::run_concurrent(func).await {
3235
tracing::error!(error = %err, "run error");

test/dockerized/scenarios/lmi_scenarios.py renamed to test/dockerized/scenarios/concurrent_scenarios.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
HANDLER = "basic-lambda-concurrent"
1212
IMAGE = os.environ.get("TEST_IMAGE", "local/test-base")
13-
DEFAULT_CONCURRENCY = 1
13+
DEFAULT_CONCURRENCY = 2
1414

1515

1616
def _make_env(concurrency: int = DEFAULT_CONCURRENCY) -> dict:
@@ -21,7 +21,7 @@ def _make_env(concurrency: int = DEFAULT_CONCURRENCY) -> dict:
2121
}
2222

2323

24-
def get_lmi_scenarios():
24+
def get_concurrent_scenarios():
2525
scenarios = []
2626

2727
# Happy path: DEFAULT_CONCURRENCY unique commands all succeed concurrently
@@ -33,18 +33,18 @@ def get_lmi_scenarios():
3333
for i in range(DEFAULT_CONCURRENCY)
3434
]
3535
scenarios.append(ConcurrentTest(
36-
name="lmi_concurrent_happy_path",
36+
name="concurrent_happy_path",
3737
handler=HANDLER,
3838
environment_variables=_make_env(),
3939
request_batches=[batch],
4040
image=IMAGE,
4141
))
4242

43-
# Error isolation: 9 invalid payloads + 1 valid — the valid one must still succeed
43+
# Error isolation: N-1 invalid payloads + 1 valid — the valid one must still succeed
4444
mixed_batch = [
4545
Request(
4646
payload={"not_a_command": "oops"},
47-
assertions=[{"transform": ".errorType", "error": "Runtime.UnmarshalError"}],
47+
assertions=[{"errorType": "&lambda_runtime::deserializer::DeserializeError"}],
4848
)
4949
for _ in range(DEFAULT_CONCURRENCY - 1)
5050
] + [
@@ -54,7 +54,7 @@ def get_lmi_scenarios():
5454
)
5555
]
5656
scenarios.append(ConcurrentTest(
57-
name="lmi_error_isolation",
57+
name="concurrent_error_isolation",
5858
handler=HANDLER,
5959
environment_variables=_make_env(),
6060
request_batches=[mixed_batch],

0 commit comments

Comments
 (0)