Skip to content

Test gaps: aiohttp paths, privacy claim, self-instrumentation, 5xx retry #9

@AndresL230

Description

@AndresL230

Summary

Four explicit claims in the README have no test coverage:

  • aiohttp interceptor branch. _interceptor.py patches aiohttp.ClientSession._request, but tests/test_interceptor.py only covers urllib3, httpx sync, and httpx async. Zero direct aiohttp tests.
  • No headers/bodies captured (privacy contract). Add a test that asserts RawEvent-shaped output carries no dict-typed payload field, plus a test that issues a request with sensitive headers and confirms they don't surface.
  • No self-instrumentation. Verify that urllib.request calls made from _post_cloud do not trigger the urllib3 patch.
  • 5xx retry path. test_no_retry_on_4xx exists but no positive test that max_retries actually runs n attempts with exponential backoff.

Also missing:

  • deprecation-warning test for flush_interval
  • would_overflow early-flush path test
  • handle.dispose() actually stops new flushes
  • _LocalTransport graceful no-op when websockets missing
  • Flask graceful degradation when flask is missing

Fix

Add tests for each. The aiohttp tests should mirror the existing httpx async tests (success, 4xx capture, latency, response-bytes, double-count guard via reentrancy).

Files

  • tests/test_interceptor.py
  • tests/test_transport.py
  • tests/test_init.py
  • tests/test_flask.py

Priority

P1 — the most-marketed claims (privacy, no self-trace) are unverified; an entire interceptor branch (aiohttp) is untested.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Should fix before next releasetestTest gap or test infrastructure

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions