Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use Timer.CancelAsync from polyfill #3836

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,7 @@ public async Task<int> RunAsyncAndReturnExitCodeAsync(
var timedOut = Task.Delay(TimeSpan.FromSeconds(seconds), stopTheTimer.Token);
if (await Task.WhenAny(exited, timedOut) == exited)
{
#if NET8_0_OR_GREATER
await stopTheTimer.CancelAsync();
#else
#pragma warning disable VSTHRD103 // Call async methods when in an async method
stopTheTimer.Cancel();
#pragma warning restore VSTHRD103 // Call async methods when in an async method
#endif
return await exited;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@
<ProjectCapability Remove="TestingPlatformServer" />
</ItemGroup>

<ItemGroup>
<Using Include="Polyfills" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

using System.Diagnostics;

#if NETSTANDARD
using Polyfills;
#endif

namespace Microsoft.Testing.TestInfrastructure;

public sealed class ProcessHandle : IProcessHandle, IDisposable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
using System.Text;
using System.Xml.Linq;

using Polyfills;

namespace Microsoft.Testing.TestInfrastructure;

public class VSSolution : Folder
Expand Down