Skip to content

Stabilize ToolTaskThatTimeoutAndRetry test#13489

Merged
rainersigwald merged 5 commits intomainfrom
tooltask-timeout-retry-test
Apr 14, 2026
Merged

Stabilize ToolTaskThatTimeoutAndRetry test#13489
rainersigwald merged 5 commits intomainfrom
tooltask-timeout-retry-test

Conversation

@rainersigwald
Copy link
Copy Markdown
Member

@rainersigwald rainersigwald commented Apr 6, 2026

  • Change fastDelayMilliseconds from NativeMethodsShared.IsWindows ? 1_000 : 100 to a flat 100
  • Verify test passes

rainersigwald and others added 2 commits April 6, 2026 11:29
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make the retry test assert the timeout scenario explicitly, log per-attempt diagnostics, and keep the follow-up executions deterministic across retries.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 6, 2026 16:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR stabilizes the ToolTaskThatTimeoutAndRetry unit test in Utilities.UnitTests by removing timing-sensitive shell indirection and making the timeout/retry expectations explicit and easier to diagnose when failures occur in CI.

Changes:

  • Replace the shell-based sleep invocation with direct OS tools (sleep on Unix, ping.exe on Windows) and document the timeout.exe limitation under ToolTask.
  • Refactor the theory inputs and assertions to explicitly model “first attempt times out, subsequent attempts succeed”.
  • Add per-attempt diagnostic output (including exit code) and clear the mock engine log between attempts to keep logs readable.

Comment thread src/Utilities.UnitTests/ToolTask_Tests.cs
Comment thread src/Utilities.UnitTests/ToolTask_Tests.cs Outdated
Comment thread src/Utilities.UnitTests/ToolTask_Tests.cs Outdated
Comment thread src/Utilities.UnitTests/ToolTask_Tests.cs
Agent-Logs-Url: https://github.com/dotnet/msbuild/sessions/81558234-b82a-4e91-8cbe-75dc53221865

Co-authored-by: rainersigwald <3347530+rainersigwald@users.noreply.github.com>
@rainersigwald rainersigwald self-assigned this Apr 14, 2026
@rainersigwald rainersigwald merged commit 1549919 into main Apr 14, 2026
10 checks passed
@rainersigwald rainersigwald deleted the tooltask-timeout-retry-test branch April 14, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants