Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions tests/integrations/aws_lambda/test_aws_lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,27 +201,6 @@ def test_init_error(lambda_client, test_environment):
assert transaction_event["transaction"] == "InitError"


def test_timeout_error(lambda_client, test_environment):
lambda_client.invoke(
FunctionName="TimeoutError",
Payload=json.dumps({}),
)
envelopes = test_environment["server"].envelopes

(error_event,) = envelopes

assert error_event["level"] == "error"
assert error_event["extra"]["lambda"]["function_name"] == "TimeoutError"

(exception,) = error_event["exception"]["values"]
assert not exception["mechanism"]["handled"]
assert exception["type"] == "ServerlessTimeoutWarning"
assert exception["value"].startswith(
"WARNING : Function is expected to get timed out. Configured timeout duration ="
)
assert exception["mechanism"]["type"] == "threading"


def test_timeout_error_scope_modified(lambda_client, test_environment):
lambda_client.invoke(
FunctionName="TimeoutErrorScopeModified",
Expand Down
6 changes: 6 additions & 0 deletions tests/integrations/aws_lambda/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@

PYTHON_VERSION = f"python{sys.version_info.major}.{sys.version_info.minor}"

# Match the host CPU architecture so local runs on ARM machines (e.g. macOS)
# don't run the Lambda containers under slow x86_64 emulation.
ARCHITECTURE = "arm64" if platform.machine() in ("arm64", "aarch64") else "x86_64"


def get_host_ip():
"""
Expand Down Expand Up @@ -105,6 +109,7 @@ def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
"CodeUri": os.path.join(LAMBDA_FUNCTION_DIR, lambda_dir),
"Handler": "sentry_sdk.integrations.init_serverless_sdk.sentry_lambda_handler",
"Runtime": PYTHON_VERSION,
"Architectures": [ARCHITECTURE],
"Timeout": LAMBDA_FUNCTION_TIMEOUT,
"Layers": [
{"Ref": self.sentry_layer.logical_id}
Expand Down Expand Up @@ -172,6 +177,7 @@ def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
"Handler": "index.handler",
"Runtime": PYTHON_VERSION,
"Timeout": LAMBDA_FUNCTION_TIMEOUT,
"Architectures": [ARCHITECTURE],
"Environment": {
"Variables": {
"SENTRY_DSN": dsn,
Expand Down
Loading