diff --git a/features/aws-lambda/handled.feature b/features/aws-lambda/handled.feature index ebb20a92..0060a70c 100644 --- a/features/aws-lambda/handled.feature +++ b/features/aws-lambda/handled.feature @@ -1,6 +1,5 @@ # 3.9 is currently the minimum python version with a lambda runtime -# 3.14 is not supported by the AWS `sam` CLI at the moment -@not-python-3.5 @not-python-3.6 @not-python-3.7 @not-python-3.8 @not-python-3.14 +@not-python-3.5 @not-python-3.6 @not-python-3.7 @not-python-3.8 Feature: Handled exceptions in AWS Lambda Scenario: Handled exceptions are delivered in an AWS Lambda app diff --git a/features/aws-lambda/sessions.feature b/features/aws-lambda/sessions.feature index 3e85cf99..ca3739ca 100644 --- a/features/aws-lambda/sessions.feature +++ b/features/aws-lambda/sessions.feature @@ -1,4 +1,4 @@ -@not-python-3.5 @not-python-3.6 @not-python-3.7 @not-python-3.8 @not-python-3.14 +@not-python-3.5 @not-python-3.6 @not-python-3.7 @not-python-3.8 Feature: Sessions in AWS Lambda Scenario: Manually started sessions are delivered in an AWS Lambda app when auto_capture_sessions is True diff --git a/features/aws-lambda/unhandled.feature b/features/aws-lambda/unhandled.feature index c21d43f1..f3c0acb6 100644 --- a/features/aws-lambda/unhandled.feature +++ b/features/aws-lambda/unhandled.feature @@ -1,4 +1,4 @@ -@not-python-3.5 @not-python-3.6 @not-python-3.7 @not-python-3.8 @not-python-3.14 +@not-python-3.5 @not-python-3.6 @not-python-3.7 @not-python-3.8 Feature: Unhandled exceptions in AWS Lambda Scenario: Unhandled exceptions are delivered in an AWS Lambda app diff --git a/features/support/env.rb b/features/support/env.rb index 9f3ae675..1fb69453 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -15,12 +15,12 @@ def current_ip Maze.config.file_log = false Maze.config.log_requests = true - # don't wait so long for requests/not to receive requests - Maze.config.receive_requests_wait = 10 - Maze.config.receive_no_requests_wait = 10 + # Increased timeout to 20s for AWS Lambda cold starts (especially Python 3.12+) + Maze.config.receive_requests_wait = 20 + Maze.config.receive_no_requests_wait = 20 - # warn if a test takes more than 5 seconds to send a request - Maze.config.receive_requests_slow_threshold = 5 + # warn if a test takes more than 10 seconds to send a request + Maze.config.receive_requests_slow_threshold = 10 # bugsnag-python doesn't need to send the integrity header Maze.config.enforce_bugsnag_integrity = false diff --git a/tests/integrations/test_asgi.py b/tests/integrations/test_asgi.py index e998f32f..bb5bed88 100644 --- a/tests/integrations/test_asgi.py +++ b/tests/integrations/test_asgi.py @@ -39,11 +39,12 @@ def test_routing_crash(self): async def other_func(): raise ScaryException('fell winds!') - @app.route('/') async def index(req): await other_func() return PlainTextResponse('pineapple') + app.add_route('/', index) + app = TestClient(BugsnagMiddleware(app)) self.assertRaises(ScaryException, lambda: app.get('/')) @@ -77,11 +78,12 @@ def test_enable_environment(self): async def other_func(): raise ScaryException('fell winds!') - @app.route('/') async def index(req): await other_func() return PlainTextResponse('pineapple') + app.add_route('/', index) + app = TestClient(BugsnagMiddleware(app)) self.assertRaises(ScaryException, lambda: app.get('/')) @@ -106,11 +108,12 @@ def test_headers_are_filtered(self): async def other_func(): raise ScaryException('fell winds!') - @app.route('/') async def index(req): await other_func() return PlainTextResponse('pineapple') + app.add_route('/', index) + app = TestClient(BugsnagMiddleware(app)) self.assertRaises( @@ -159,11 +162,12 @@ async def next_func(): bugsnag.configure_request(metadata={'wave': {'size': '35b'}}) raise ScaryException('fell winds!') - @app.route('/') async def index(req): await next_func() return PlainTextResponse('pineapple') + app.add_route('/', index) + app = TestClient(BugsnagMiddleware(app)) self.assertRaises(ScaryException, lambda: app.get('/')) @@ -229,10 +233,11 @@ async def app(scope, receive, send): def test_url_components(self): app = Starlette() - @app.route('/path') async def index(req): raise ScaryException('forgot the map') + app.add_route('/path', index) + app = TestClient(BugsnagMiddleware(app)) self.assertRaises( @@ -261,11 +266,12 @@ def test_breadcrumb_records_the_referer_header(self): async def other_func(): raise ScaryException('fell winds!') - @app.route('/') async def index(req): await other_func() return PlainTextResponse('pineapple') + app.add_route('/', index) + app = TestClient(BugsnagMiddleware(app)) headers = {'referer': 'http://testserver/abc/xyz?password=hunter2'} @@ -305,13 +311,14 @@ def test_chained_exceptions(self): async def other_func(): raise ScaryException('fell winds!') - @app.route('/') async def index(req): try: await other_func() except ScaryException as scary: raise Exception('disconcerting breeze.') from scary + app.add_route('/', index) + app = TestClient(BugsnagMiddleware(app)) with pytest.raises(Exception): @@ -351,7 +358,6 @@ async def other_func(): raise ScaryException('fell winds!') - @app.route('/') async def index(req): nonlocal count count += 1 @@ -360,6 +366,8 @@ async def index(req): await other_func() return PlainTextResponse('pineapple') + app.add_route('/', index) + app = TestClient(BugsnagMiddleware(app)) with pytest.raises(Exception):