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 FlushAsync from polyfill #3834

Merged
merged 8 commits into from
Sep 21, 2024
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
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<PackageVersion Include="Microsoft.TestPlatform.ObjectModel" Version="$(MicrosoftNETTestSdkVersion)" />
<PackageVersion Include="Microsoft.TestPlatform.TranslationLayer" Version="$(MicrosoftNETTestSdkVersion)" />
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.0.0" />
<PackageVersion Include="Polyfill" Version="6.2.3" />
<PackageVersion Include="Polyfill" Version="6.9.0" />
<!-- CVE-2019-0820 -->
<PackageVersion Include="System.Diagnostics.TextWriterTraceListener" Version="4.3.0" />
<!-- CVE-2019-0981, CVE-2019-0980, CVE-2019-0657 -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@

using System.Text;

#if !NET8_0_OR_GREATER
using Microsoft.Testing.Platform.Helpers;
#endif

#if NETCOREAPP
using System.Buffers;
#else
using Microsoft.Testing.Platform.Helpers;
#endif

namespace Microsoft.Testing.Platform.ServerMode;
Expand Down Expand Up @@ -129,11 +127,7 @@ public async Task WriteRequestAsync(RpcMessage message, CancellationToken cancel
await _writer.WriteLineAsync("Content-Type: application/testingplatform");
await _writer.WriteLineAsync();
await _writer.WriteAsync(messageStr);
#if NET8_0_OR_GREATER
await _writer.FlushAsync(cancellationToken);
#else
await _writer.FlushAsync().WithCancellationAsync(cancellationToken);
#endif
}

protected virtual void Dispose(bool disposing)
Expand Down