[FEAT]: Stream xdist results through test reports - #166
Merged
Nina Chikanov (nina-msft) merged 6 commits intoAug 17, 2026
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0ab46710-f0d9-4941-bbd5-eac658126165
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0ab46710-f0d9-4941-bbd5-eac658126165
Contributor
There was a problem hiding this comment.
Pull request overview
Streams xdist Results incrementally through call-phase reports, preserving delivered Results after worker failures.
Changes:
- Adds per-Result serialization, validation, size caps, and controller merging.
- Reconciles streamed counts during worker shutdown.
- Expands tests and documentation for durability, ordering, and truncation.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
rampart/pytest_plugin/_xdist.py |
Implements streamed transport and reconciliation. |
rampart/pytest_plugin/plugin.py |
Integrates streaming with pytest hooks. |
rampart/pytest_plugin/_session.py |
Extracts result tagging and deduplicates incomplete reasons. |
tests/unit/pytest_plugin/test_xdist.py |
Tests serialization, validation, caps, and reconciliation. |
tests/unit/pytest_plugin/test_xdist_aggregation.py |
Adds real-xdist streaming integration tests. |
tests/unit/pytest_plugin/test_plugin.py |
Tests worker attachment and controller merging hooks. |
docs/usage/xdist.md |
Documents streamed transport behavior. |
docs/usage/configuration.md |
Updates size-cap configuration. |
docs/usage/ci-integration.md |
Updates CI option guidance. |
docs/contributing/architecture.md |
Revises plugin architecture documentation. |
docs/api/pytest-plugin.md |
Updates documented xdist APIs. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Use pytest item display names for Result metadata and resolve the xdist transport cap once per report envelope. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0ab46710-f0d9-4941-bbd5-eac658126165
Nina Chikanov (nina-msft)
marked this pull request as ready for review
August 14, 2026 19:43
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.
Suppressed comments (1)
rampart/pytest_plugin/plugin.py:499
- A fixture can record a Result and then fail or skip during setup. Pytest emits no call-phase report in that case, so this branch never transports the collected Result. The worker consequently publishes an emitted count of zero, which matches the controller's zero and silently produces a complete-looking report with the Result missing. Stream the active collector on non-passing setup reports (while retaining call-only streaming for successful setup) or otherwise reconcile collected versus emitted Results.
collector = get_active_collector()
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0ab46710-f0d9-4941-bbd5-eac658126165
Stream setup-recorded Results on failed or skipped setup reports while deferring successful setup Results to the call report and keeping teardown outside transport. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0ab46710-f0d9-4941-bbd5-eac658126165
Spencer Schoenberg (spencrr)
approved these changes
Aug 14, 2026
Spencer Schoenberg (spencrr)
left a comment
Contributor
There was a problem hiding this comment.
If it fits, it ships! 📦🚀
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The previous end-of-worker xdist batch could lose every Result from a worker that crashed before session finish and applied the size cap to the worker payload as a whole. This PR replaces that batch with incremental call-report streaming so the controller retains each Result as soon as its TestReport arrives.
This builds on the collector call-phase snapshot delivered by #152, which is now merged into
main.Approach
pytest_runtest_logreport, tags source workers, and preserves deterministic ordering, including--dist=each.A killed worker retains every Result already delivered to the controller. The repository harness does not provide a deterministic remote/non-popen gateway, so that topology remains a residual integration risk.
Validation
python -m pytest tests\unit\pytest_plugin -q- 198 passedruff check .ruff format --check .ty checkBreaking changes
None. Mixed worker/controller transport versions remain unsupported and now fail closed under the v2 schema.
Checklist
pre-commit run --all-filespasses