chore(ci_visibility): early exit for retry mechanisms#16581
Draft
chore(ci_visibility): early exit for retry mechanisms#16581
Conversation
Co-authored-by: gnufede <412857+gnufede@users.noreply.github.com>
Codeowners resolved as |
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.
PR by Bits
View session in Datadog
Comment @DataDog to request changes
Feedback (especially what can be better) welcome in #code-gen-aka-bits-dev-feedback!
Description
Implements early exit logic for retry mechanisms to reduce unnecessary overhead on customer CI. This change prevents scheduling further test retries once the purpose of each retry mechanism has been fulfilled:
The implementation adds state tracking to the
Testclass to record whether it has passed or failed at any point, then uses these flags in each retry handler'sshould_retry()method to determine early exit conditions.Testing
Updated test expectations in
test_pytest_efd.pyto reflect the reduced number of retries:Risks
Low risk. The changes are additive and only add early exit conditions without modifying existing retry logic. Behavior is only affected when early exit conditions are met, which improves efficiency without changing correctness.
Additional Notes
The implementation leverages the existing
set_status()method onTestRunto track test outcomes, ensuring state is updated whenever a test status is recorded. This approach maintains a single source of truth for test status information.