feat(flaky-detection): Add pytest-xdist support to flaky detection system#383
Closed
Conversation
…stem Add full flaky detection support under pytest-xdist using controller- orchestrated pre-computed deadlines and xdist's built-in IPC. Architecture: - Controller fetches flaky detection context from API once, distributes it to workers via workerinput - Each worker constructs a FlakyDetector from the serialized context, computes the same global budget, runs tests with reruns - Workers send metrics back via workeroutput - Controller aggregates metrics and generates the terminal report Changes: - Add FlakyDetector.from_context() classmethod for worker-side construction - Add to_serializable_metrics() for xdist IPC (plain builtins only) - Add make_report_from_aggregated() for controller-side reporting - Add static deadline mode (_is_xdist flag) preserving dynamic for non-xdist - Add MergifyCIInsights.load_flaky_detector_from_context() - Add controller hooks (pytest_configure_node, pytest_testnodedown) - Add worker hooks (workerinput loading, workeroutput export) - Disable flaky detection under 'each' scheduling mode - Add pytest-xdist dev dependency and integration tests Fixes: MRGFY-6296 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Change-Id: I31dc94df9451d8b4bf166166e03453dda6168c18
Contributor
Author
|
This pull request is part of a stack: |
This was referenced Mar 19, 2026
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🔴 ⛓️ Depends-On RequirementsThis rule is failing.Requirement based on the presence of
🔴 ApprovalThis rule is failing.
🔴 🔎 ReviewsThis rule is failing.
🟢 Continuous IntegrationWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
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.
Add full flaky detection support under pytest-xdist using controller-
orchestrated pre-computed deadlines and xdist's built-in IPC.
Architecture:
it to workers via workerinput
computes the same global budget, runs tests with reruns
Changes:
Fixes: MRGFY-6296
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
Depends-On: #382