Add --retry-failed-tests-delay option to MTP retry package#7840
Draft
Add --retry-failed-tests-delay option to MTP retry package#7840
--retry-failed-tests-delay option to MTP retry package#7840Conversation
Agent-Logs-Url: https://github.com/microsoft/testfx/sessions/b65299ab-c298-41e1-b995-33ae9f177b0b Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add --retry-delay-seconds option for MTP retry
Add Apr 25, 2026
--retry-failed-tests-delay option to MTP retry package
2 tasks
Youssef1313
reviewed
Apr 26, 2026
| { | ||
| TimeSpan delay = TimeSpanParser.Parse(retryDelay[0]); | ||
| await logger.LogDebugAsync($"Waiting {delay} before next retry attempt").ConfigureAwait(false); | ||
| await Task.Delay(delay, cancellationToken).ConfigureAwait(false); |
Member
There was a problem hiding this comment.
Is this:
- adding the delay even when we are on the last attempt?
- Also delaying moving test results to the correct attempt results directory?
I think it's more clear to add the delay just before Process.Start exactly, with a condition that it's not the first attempt.
Overall, I don't think a single request for the feature is worth adding it, but up to you if you think it's useful enough to add it.
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.
The retry extension had no way to introduce a wait between retry attempts, making it less useful for tests interacting with external systems (message queues, databases, etc.) where a cooldown period reduces flakiness.
Changes
--retry-failed-tests-delay: accepts a timespan value using the same unit-aware format as--hangdump-timeout(e.g.200,1s,2.5m,1h; default unit is milliseconds)RetryCommandLineOptionsProvider: registers the option, validates it requires--retry-failed-tests, and validates the argument viaTimeSpanParser.TryParseRetryOrchestrator: strips the delay arg from arguments forwarded to child processes; appliesTask.Delaybetween attempts (not after the final attempt)Usage