Skip to content

ci(aiohttp): stabilize base_url snapshot#17507

Open
quinna-h wants to merge 1 commit intomainfrom
dd/fix/aiohttp-base-url-snapshot-flake
Open

ci(aiohttp): stabilize base_url snapshot#17507
quinna-h wants to merge 1 commit intomainfrom
dd/fix/aiohttp-base-url-snapshot-flake

Conversation

@quinna-h
Copy link
Copy Markdown
Contributor

@quinna-h quinna-h commented Apr 13, 2026

Description

Fixing test_base_url[py3.13]Questions? Ask in #code-gen-flaky-tests

This change stabilizes the test_base_url[py3.13] flaky snapshot assertion in tests/contrib/aiohttp/test_aiohttp_client.py.

This test has a high CI impact (2.7% flake rate). The failure was caused by nondeterministic presence of the _dd.svc_src span meta tag in the aiohttp.request snapshot, which made snapshot comparison fail when the tag appeared.

Changes

  • Updated test_base_url to call snapshot_context(ignores=["meta._dd.svc_src"]).
  • Kept the test behavior and assertions otherwise unchanged; this is a test-only fix scoped to snapshot normalization for an environment-dependent metadata field.

Testing

  • ruff format tests/contrib/aiohttp/test_aiohttp_client.py (no changes).
  • ruff check --fix tests/contrib/aiohttp/test_aiohttp_client.py (passed).
  • Output of CI run and aiohttp test suites passing (see below)

Risks

Low. The change is isolated to one test and only ignores a nondeterministic metadata tag that is not part of the functional behavior being validated (base URL expansion in aiohttp request spans).

Additional Notes

None.


PR by Bits - View session in Datadog

Comment @DataDog to request changes

DD_8W6DFU

Co-authored-by: quinna-h <175135214+quinna-h@users.noreply.github.com>
@datadog-datadog-prod-us1
Copy link
Copy Markdown
Contributor

View session in Datadog

Bits Dev status: ✅ Done

CI Auto-fix: Disabled | Enable

Comment @DataDog to request changes

@quinna-h quinna-h requested review from a team as code owners April 13, 2026 18:08
@quinna-h quinna-h requested a review from emmettbutler April 13, 2026 18:08
@quinna-h quinna-h requested a review from wantsui April 13, 2026 18:08
@datadog-datadog-prod-us1-2
Copy link
Copy Markdown
Contributor

I can only run on private repositories.

@cit-pr-commenter-54b7da
Copy link
Copy Markdown

Codeowners resolved as

tests/contrib/aiohttp/test_aiohttp_client.py                            @DataDog/apm-core-python @DataDog/apm-idm-python

@quinna-h quinna-h changed the title fix(aiohttp): stabilize base_url snapshot ci(aiohttp): stabilize base_url snapshot Apr 13, 2026
@quinna-h quinna-h marked this pull request as draft April 13, 2026 18:12
@quinna-h quinna-h added the changelog/no-changelog A changelog entry is not required for this PR. label Apr 13, 2026
@quinna-h quinna-h marked this pull request as ready for review April 13, 2026 19:58
The full URL (base + path) is captured in the span
"""
with snapshot_context():
with snapshot_context(ignores=["meta._dd.svc_src"]):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is indeed a quick win but I don't think we should go that path.

We should probably try to understand why it appears/disappears

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somewhat related is this PR that adjusts for the new _dd.svc_src tag: #17558

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also the case that this ignore is applied globally, so I would expect this change to be a no-op.

Copy link
Copy Markdown
Collaborator

@emmettbutler emmettbutler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This conflicts with the near-term goal of including svc_src in snapshot comparisons

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bits AI changelog/no-changelog A changelog entry is not required for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants