Skip to content

Merge branch 'master' into feat/async-transport

c88848e
Select commit
Loading
Failed to load commit list.
Merged

feat: Add experimental async transport (port of PR #4572) #5646

Merge branch 'master' into feat/async-transport
c88848e
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden: find-bugs completed Mar 30, 2026 in 17m 1s

2 issues

find-bugs: Found 2 issues (1 medium, 1 low)

Medium

Test test_loop_close_flushes_async_transport will always fail due to isinstance check with Mock - `tests/integrations/asyncio/test_asyncio.py:669-677`

The test creates mock_transport = Mock(spec=AsyncHttpTransport) and sets it as mock_client.transport. However, in the actual _flush() function (asyncio.py line 71), there's a check isinstance(client.transport, AsyncHttpTransport) which will always return False for a Mock object, even with spec=AsyncHttpTransport. The spec parameter only controls which attributes are available on the mock, not its type hierarchy. As a result, _flush() returns early without calling close_async(), causing the assertion mock_client.close_async.assert_called_once() to fail.

Low

Missing global scope cleanup in test_async_transport_concurrent_requests causes test pollution - `tests/test_transport.py:998`

The test test_async_transport_concurrent_requests sets sentry_sdk.get_global_scope().set_client(client) at line 998 but never cleans it up with a finalizer. Other similar tests in this file (e.g., test_transport_works_async at line 928, test_async_transport_rate_limiting_with_concurrency at line 1024) properly add request.addfinalizer(lambda: sentry_sdk.get_global_scope().set_client(None)). This inconsistency can cause test pollution where the client leaks into subsequent tests.


Duration: 16m 58s · Tokens: 11.3M in / 69.9k out · Cost: $16.90 (+extraction: $0.01, +merge: $0.00)

Annotations

Check warning on line 677 in tests/integrations/asyncio/test_asyncio.py

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: find-bugs

Test test_loop_close_flushes_async_transport will always fail due to isinstance check with Mock

The test creates `mock_transport = Mock(spec=AsyncHttpTransport)` and sets it as `mock_client.transport`. However, in the actual `_flush()` function (asyncio.py line 71), there's a check `isinstance(client.transport, AsyncHttpTransport)` which will always return `False` for a Mock object, even with `spec=AsyncHttpTransport`. The `spec` parameter only controls which attributes are available on the mock, not its type hierarchy. As a result, `_flush()` returns early without calling `close_async()`, causing the assertion `mock_client.close_async.assert_called_once()` to fail.