Skip to content

Commit babfa61

Browse files
committed
Document DisposeAsync intent.
1 parent 0d72795 commit babfa61

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎src/libraries/Common/tests/System/Net/RemoteExecutorExtensions.cs‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ namespace Microsoft.DotNet.RemoteExecutor;
88

99
internal static class RemoteExecutorExtensions
1010
{
11+
/// <summary>
12+
/// Dispose the RemoteInvokeHandle synchronously can take considerable time, and cause other unrelated tests to fail on timeout
13+
/// because of depletion of xUnit synchronization context threads.
14+
/// Running dispose in a separate task on the thread pool can help alleviate this issue.
15+
/// </summary>
16+
/// <example>
17+
/// Executes the ServerCode in separate process and awaits its completion in a separate task outside of current synchronization context.
18+
/// <code>
19+
/// await RemoteExecutor.Invoke(ServerCode).DisposeAsync();
20+
/// </code>
21+
/// </example>
1122
public static async ValueTask DisposeAsync(this RemoteInvokeHandle handle)
1223
{
1324
await Task.Run(handle.Dispose);

0 commit comments

Comments
 (0)