Skip to content

test(aiomysql): Add span streaming variants to aiomysql tests#6601

Merged
ericapisani merged 1 commit into
masterfrom
py-2523-add-span-streaming-tests-to-aiomysql
Jun 18, 2026
Merged

test(aiomysql): Add span streaming variants to aiomysql tests#6601
ericapisani merged 1 commit into
masterfrom
py-2523-add-span-streaming-tests-to-aiomysql

test(aiomysql): Add span streaming variants to aiomysql tests

320544f
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden completed Jun 17, 2026 in 0s

2 issues

Medium

Streaming span is serialized before `add_query_source` is called, making the threshold assertion vacuously true - `tests/integrations/aiomysql/test_aiomysql.py:703-707`

The fake_record_sql_queries_streaming mock in the span_streaming=True branch exits the inner with record_sql_queries(...) as span: pass block immediately, causing StreamedSpan._end() to fire and serialize the span to the batcher before timestamps are mocked and before add_query_source runs. The assertion assert "code.line.number" not in data will always pass regardless of the threshold logic, meaning a regression that always adds code source would go undetected.

Low

Streaming `test_no_query_source_if_duration_too_short` verifies no-op behavior, not threshold logic - `tests/integrations/aiomysql/test_aiomysql.py:704-708`

The fake_record_sql_queries_streaming context manager exits the inner with record_sql_queries(...) as span: pass block immediately, which triggers span._end()client._capture_telemetry()span._to_json() and batches the already-serialized span before yield span. Since add_query_source(span) is called by the aiomysql wrapper only after the yield, any attributes it might add to span._attributes won't appear in the captured payload — so the assertion assert "code.line.number" not in data always passes regardless of whether the threshold check is broken.

4 skills analyzed
Skill Findings Duration Cost
security-review 0 7.7s $0.08
code-review 1 6m 23s $0.97
find-bugs 1 15m 37s $1.96
skill-scanner 0 8.6s $0.07

⏱ 22m 16s · 2.7M in / 82.5k out · $3.08