Skip to content

Fix OleTxTests.Recovery CI timeout by bounding remote process wall-clock time#125813

Open
Copilot wants to merge 4 commits intomainfrom
copilot/fix-recovery-timeout-error
Open

Fix OleTxTests.Recovery CI timeout by bounding remote process wall-clock time#125813
Copilot wants to merge 4 commits intomainfrom
copilot/fix-recovery-timeout-error

Conversation

Copy link
Contributor

Copilot AI commented Mar 20, 2026

Description

OleTxTests.Recovery repeatedly times out the CI work item (the entire System.Transactions.Local.Tests work item is killed). The CI error gives no detail beyond the timeout — no stack traces or indication of where the hang occurs.

The most likely scenario is that MSDTC is unresponsive on certain CI machines, causing the child process spawned by RemoteExecutor.Invoke to hang (either stuck in MSDTC COM interop, or sitting in its intentional Thread.Sleep waiting for a commit callback that never arrives). Since RemoteInvokeOptions.TimeOut defaults to Timeout.Infinite, RemoteInvokeHandle.Dispose() blocks indefinitely waiting for the child to exit, and the test never completes.

It's also possible the main test thread hangs in tx.Commit() or one of the WaitOne(Timeout) calls. This change would not help in that case — only the child process is bounded. If the timeout continues to repro after this change, the main thread is the more likely culprit and would need its own timeout or the test should be skipped on affected CI legs.

Change:

  • Add TimeOut = 120_000 to RemoteInvokeOptions so RemoteInvokeHandle.Dispose() will force-kill the child process after 2 minutes (with a diagnostic dump at the halfway point) instead of blocking indefinitely. This bounds the test's wall-clock time and should prevent it from consuming the entire work item timeout budget.

Changes

  • src/libraries/System.Transactions.Local/tests/OleTxTests.cs

Testing

This change targets a flaky/hanging test; no new test logic is added. The fix will be validated by the reduction in CI work item timeouts on Windows runs. The test requires MSDTC and cannot be run locally in most environments (the ConditionalFact skips it when MSDTC is unavailable).

…all-clock time

Co-authored-by: danmoseley <6385855+danmoseley@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix recovery timeout error in OleTx tests Fix OleTxTests.Recovery CI timeout by bounding remote process and test wall-clock time Mar 20, 2026
Copilot AI requested a review from danmoseley March 20, 2026 00:37
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @SamMonoRT, @dotnet/efteam
See info in area-owners.md if you want to be subscribed.

@danmoseley danmoseley requested a review from Copilot March 20, 2026 00:50
Copy link
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@danmoseley danmoseley requested a review from Copilot March 20, 2026 01:16
Copy link
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

…out on async methods)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@danmoseley danmoseley changed the title Fix OleTxTests.Recovery CI timeout by bounding remote process and test wall-clock time Fix OleTxTests.Recovery CI timeout by bounding remote process wall-clock time Mar 20, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@danmoseley danmoseley marked this pull request as ready for review March 20, 2026 02:19
Copilot AI review requested due to automatic review settings March 20, 2026 02:19
@danmoseley danmoseley requested a review from AndriySvyryd March 20, 2026 02:21
Copy link
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

System.Transactions.Tests.OleTxTests.Recovery timeout

4 participants