test(xdist): Observe what a distributed run puts on the wire - #512
Conversation
PR Risk Assessment🟢 Low risk — labeled
A reviewer can add or remove the label at any time. |
Merge Protections🔴 2 of 6 protections blocking · waiting on 👀 reviews
🔴 ApprovalWaiting for any of
This rule is failing.
🔴 🔎 ReviewsWaiting for
This rule is failing.
Show 4 satisfied protections🟢 Continuous Integration
🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 📕 PR description
🟢 🚦 Auto-queueWhen all merge protections are satisfied, this pull request will be queued automatically. |
There was a problem hiding this comment.
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_collectorfixture. - Updates existing upload assertions to use
uploading_collectorinstead 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.
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
b766a9e to
2877e59
Compare
Revision history
|
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_spanskept to itself into afixture, so a test wanting the real wire asks for one thing rather than
restating seven environment variables, and cover
-n 2with it.