From 6dbf1ca398b172f154a0b3d11ef83250b4be5a53 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 14 Sep 2024 11:02:07 +1000 Subject: [PATCH 1/4] use FlushAsync from polyfill --- .../ServerMode/JsonRpc/StreamMessageHandler.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/StreamMessageHandler.cs b/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/StreamMessageHandler.cs index d056774c55..7ac3c24b99 100644 --- a/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/StreamMessageHandler.cs +++ b/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/StreamMessageHandler.cs @@ -129,11 +129,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) From eec49098b7a77786bd7c99066f79254ca9ed3c12 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 14 Sep 2024 11:22:45 +1000 Subject: [PATCH 2/4] . --- Directory.Packages.props | 2 +- .../ServerMode/JsonRpc/StreamMessageHandler.cs | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index f3ad23c543..6a657c9c88 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -43,7 +43,7 @@ - + diff --git a/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/StreamMessageHandler.cs b/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/StreamMessageHandler.cs index 7ac3c24b99..9515c31350 100644 --- a/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/StreamMessageHandler.cs +++ b/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/StreamMessageHandler.cs @@ -3,10 +3,6 @@ using System.Text; -#if !NET8_0_OR_GREATER -using Microsoft.Testing.Platform.Helpers; -#endif - #if NETCOREAPP using System.Buffers; #endif From dead4ffc61104a0dfac730c37a7057caf6436f20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Thu, 19 Sep 2024 10:28:46 +0200 Subject: [PATCH 3/4] Update Directory.Packages.props --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 6a657c9c88..f1f5623e44 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -43,7 +43,7 @@ - + From c7d8b6c80cb5d65844f95cae7d73558cd0bc28d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Sat, 21 Sep 2024 16:38:11 +0200 Subject: [PATCH 4/4] Fix using --- .../ServerMode/JsonRpc/StreamMessageHandler.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/StreamMessageHandler.cs b/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/StreamMessageHandler.cs index 9515c31350..e092e70a4d 100644 --- a/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/StreamMessageHandler.cs +++ b/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/StreamMessageHandler.cs @@ -5,6 +5,8 @@ #if NETCOREAPP using System.Buffers; +#else +using Microsoft.Testing.Platform.Helpers; #endif namespace Microsoft.Testing.Platform.ServerMode;