Skip to content

Skip one of the Lambda tests#3592

Merged
antonpirker merged 1 commit into
masterfrom
antonpirker/fix-awslambda-tests
Oct 1, 2024
Merged

Skip one of the Lambda tests#3592
antonpirker merged 1 commit into
masterfrom
antonpirker/fix-awslambda-tests

Conversation

@antonpirker

Copy link
Copy Markdown
Contributor

AWS Lambda has changed something in their environment and now our tests can not capture events in the init phase of the Lambda function.

Will skip the test for now.

@antonpirker antonpirker self-assigned this Oct 1, 2024
@antonpirker
antonpirker enabled auto-merge (squash) October 1, 2024 12:10
@codecov

codecov Bot commented Oct 1, 2024

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
12018 1 12017 1646
View the top 1 failed tests by shortest run time
tests.integrations.httpx.test_httpx test_omit_url_data_if_parsing_fails
Stack Traces | 5.07s run time
.tox/py3.10-httpx-v0.20/lib/python3.10.../httpx/_transports/default.py:62: in map_httpcore_exceptions
    yield
.tox/py3.10-httpx-v0.20/lib/python3.10.../httpx/_transports/default.py:177: in handle_request
    status_code, headers, byte_stream, extensions = self._pool.handle_request(
.tox/py3.10-httpx-v0.20/lib/python3.10.../httpcore/_sync/connection_pool.py:234: in handle_request
    response = connection.handle_request(
.tox/py3.10-httpx-v0.20/lib/python3.10.../httpcore/_sync/connection.py:136: in handle_request
    self.socket = self._open_socket(timeout)
.tox/py3.10-httpx-v0.20/lib/python3.10.../httpcore/_sync/connection.py:163: in _open_socket
    return self._backend.open_tcp_stream(
.tox/py3.10-httpx-v0.20/lib/python3.10.../httpcore/_backends/sync.py:136: in open_tcp_stream
    with map_exceptions(exc_map):
.../hostedtoolcache/Python/3.10.15....../x64/lib/python3.10/contextlib.py:153: in __exit__
    self.gen.throw(typ, value, traceback)
.tox/py3.10-httpx-v0.20/lib/python3.10.../site-packages/httpcore/_exceptions.py:12: in map_exceptions
    raise to_exc(exc) from None
E   httpcore.ConnectError: [Errno 101] Network is unreachable

The above exception was the direct cause of the following exception:
.../integrations/httpx/test_httpx.py:305: in test_omit_url_data_if_parsing_fails
    response = httpx_client.get(url)
.tox/py3.10-httpx-v0.20/lib/python3.10................../site-packages/httpx/_client.py:1010: in get
    return self.request(
.tox/py3.10-httpx-v0.20/lib/python3.10................../site-packages/httpx/_client.py:792: in request
    return self.send(request, auth=auth, follow_redirects=follow_redirects)
sentry_sdk/utils.py:1786: in runner
    return sentry_patched_function(*args, **kwargs)
sentry_sdk/integrations/httpx.py:87: in send
    rv = real_send(self, request, **kwargs)
.tox/py3.10-httpx-v0.20/lib/python3.10................../site-packages/httpx/_client.py:877: in send
    response = self._send_handling_auth(
.tox/py3.10-httpx-v0.20/lib/python3.10................../site-packages/httpx/_client.py:905: in _send_handling_auth
    response = self._send_handling_redirects(
.tox/py3.10-httpx-v0.20/lib/python3.10................../site-packages/httpx/_client.py:942: in _send_handling_redirects
    response = self._send_single_request(request)
.tox/py3.10-httpx-v0.20/lib/python3.10................../site-packages/httpx/_client.py:978: in _send_single_request
    response = transport.handle_request(request)
.tox/py3.10-httpx-v0.20/lib/python3.10.../httpx/_transports/default.py:176: in handle_request
    with map_httpcore_exceptions():
.../hostedtoolcache/Python/3.10.15....../x64/lib/python3.10/contextlib.py:153: in __exit__
    self.gen.throw(typ, value, traceback)
.tox/py3.10-httpx-v0.20/lib/python3.10.../httpx/_transports/default.py:79: in map_httpcore_exceptions
    raise mapped_exc(message) from exc
E   httpx.ConnectError: [Errno 101] Network is unreachable

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

@antonpirker
antonpirker merged commit a3ab1ea into master Oct 1, 2024
@antonpirker
antonpirker deleted the antonpirker/fix-awslambda-tests branch October 1, 2024 12:23
antonpirker added a commit that referenced this pull request Feb 20, 2025
The AWS integration fails to capture errors during the INIT phase (at least in Python 3.8 and above environments).

It appears tests for this were disabled after a change in AWS' own runtime environment: #3592

A change from a few months ago where it seems like string serialisation of the JSON payload was disabled and instead the `post_init_error` is invoked directly with the json payload: aws/aws-lambda-python-runtime-interface-client@a37a43a#diff-4513a869520b19ae4e30058106d7c3b5ddbb79216b5e9bd922d83389fb86c603R483

This breaks and causes an error internally when trying to parse the string back into json, and the error is actually swallowed because of `with capture_internal_exceptions()`.

Co-authored-by: Anton Pirker <anton.pirker@sentry.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants