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
3 changes: 1 addition & 2 deletions features/aws-lambda/handled.feature
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion features/aws-lambda/sessions.feature
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion features/aws-lambda/unhandled.feature
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 16 additions & 8 deletions tests/integrations/test_asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('/'))
Expand Down Expand Up @@ -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('/'))
Expand All @@ -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(
Expand Down Expand Up @@ -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('/'))
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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'}

Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -351,7 +358,6 @@ async def other_func():

raise ScaryException('fell winds!')

@app.route('/')
async def index(req):
nonlocal count
count += 1
Expand All @@ -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):
Expand Down
Loading