Skip to content
This repository was archived by the owner on Aug 10, 2026. It is now read-only.

test(xdist): Observe what a distributed run puts on the wire - #512

Draft
remyduthu wants to merge 1 commit into
mainfrom
devs/remyduthu/xdist-upload-harness/observe-what-distributed-run-puts-wire--ede84f33
Draft

test(xdist): Observe what a distributed run puts on the wire#512
remyduthu wants to merge 1 commit into
mainfrom
devs/remyduthu/xdist-upload-harness/observe-what-distributed-run-puts-wire--ede84f33

Conversation

@remyduthu

Copy link
Copy Markdown
Contributor

Every xdist worker exports from its own process, so the in-process span
exporter -- and anything the controller prints -- is blind to a test whose
span never left the worker that ran it, or that two workers each sent home.
Nothing covered that: the plugin's only multi-process assertions ran with a
single process.

Promote the upload environment test_uploaded_spans kept to itself into a
fixture, so a test wanting the real wire asks for one thing rather than
restating seven environment variables, and cover -n 2 with it.

Copilot AI review requested due to automatic review settings July 31, 2026 13:15
@mergify
mergify Bot had a problem deploying to Mergify Merge Protections July 31, 2026 13:15 Failure
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

PR Risk Assessment

🟢 Low risk — labeled low risk, so one approval is enough.

  • ✅ Safe change type (test)
  • ✅ 91 lines across 2 file(s), clear of sensitive paths

A reviewer can add or remove the label at any time.

@github-actions github-actions Bot added the low risk Merges on a single approval label Jul 31, 2026
@mergify

mergify Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 2 of 6 protections blocking · waiting on 👀 reviews

Protection Waiting on
🔴 Approval 👀 reviews
🔴 🔎 Reviews 👀 reviews
🟢 Continuous Integration
🟢 Enforce conventional commit
🟢 📕 PR description
🟢 🚦 Auto-queue

🔴 Approval

Waiting for any of

  • #approved-reviews-by >= 2
  • #approved-reviews-by >= 1
This rule is failing.
  • any of:
    • #approved-reviews-by >= 2
    • all of:
      • #approved-reviews-by >= 1
      • label = low risk

🔴 🔎 Reviews

Waiting for

  • #review-requested = 0
This rule is failing.
  • #review-requested = 0
  • #changes-requested-reviews-by = 0
  • #review-threads-unresolved = 0

Show 4 satisfied protections

🟢 Continuous Integration

  • all of:
    • check-success = codespell
    • check-success = test (3.10)
    • check-success = test (3.11)
    • check-success = test (3.12)
    • check-success = test (3.13)
    • check-success = test (3.14)
    • check-success = test (3.8)
    • check-success = test (3.9)

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|internal|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?!?:

🟢 📕 PR description

  • body ~= (?ms:.{48,})

🟢 🚦 Auto-queue

When all merge protections are satisfied, this pull request will be queued automatically.

@mergify
mergify Bot requested a review from a team July 31, 2026 13:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR improves OTLP “wire-level” test coverage for pytest-mergify by introducing a reusable fixture that configures a real uploading environment, and by adding an xdist (-n 2) test to ensure each test span is uploaded exactly once across multiple worker processes.

Changes:

  • Refactors upload-environment setup into a new uploading_collector fixture.
  • Updates existing upload assertions to use uploading_collector instead of per-test env setup.
  • Adds a new xdist-backed test to validate per-test span uniqueness across workers.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/test_uploaded_spans.py Switches upload tests to the new fixture and adds an xdist (-n 2) wire-level upload uniqueness test.
tests/conftest.py Adds uploading_collector fixture to centralize the env required for genuine uploads to the OTLP collector.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/conftest.py
Every xdist worker exports from its own process, so the in-process span
exporter -- and anything the controller prints -- is blind to a test whose
span never left the worker that ran it, or that two workers each sent home.
Nothing covered that: the plugin's only multi-process assertions ran with a
single process.

Promote the upload environment `test_uploaded_spans` kept to itself into a
fixture, so a test wanting the real wire asks for one thing rather than
restating seven environment variables, and cover `-n 2` with it.

Change-Id: Iede84f33c52f95369cdf62d2d8fdaa46097d250c
@remyduthu
remyduthu force-pushed the devs/remyduthu/xdist-upload-harness/observe-what-distributed-run-puts-wire--ede84f33 branch from b766a9e to 2877e59 Compare July 31, 2026 14:27
@remyduthu

Copy link
Copy Markdown
Contributor Author

Revision history

# Type Changes Reason Date
1 initial b766a9e 2026-07-31 14:27 UTC
2 content b766a9e → 2877e59 (raw) 2026-07-31 14:27 UTC

@mergify
mergify Bot had a problem deploying to Mergify Merge Protections July 31, 2026 14:27 Failure
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

low risk Merges on a single approval

Development

Successfully merging this pull request may close these issues.

2 participants