Skip to content

Commit c3b4850

Browse files
authored
Fix WinHttp StreamingTest backward compat version (#104722)
* Add WS2022 to OsSupport check for Bidirectional Streaming * Enable the disabled test * Add helper property to PlatformDetection.Windows for WS2022 * Use helper property for WS2022
1 parent cc8bfa5 commit c3b4850

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Windows.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public static partial class PlatformDetection
2525
public static bool IsWindows8xOrLater => IsWindowsVersionOrLater(6, 2);
2626
public static bool IsWindows10OrLater => IsWindowsVersionOrLater(10, 0);
2727
public static bool IsWindowsServer2019 => IsWindows && IsNotWindowsNanoServer && GetWindowsVersion() == 10 && GetWindowsMinorVersion() == 0 && GetWindowsBuildVersion() == 17763;
28+
public static bool IsWindowsServer2022 => IsWindows && IsNotWindowsNanoServer && GetWindowsVersion() == 10 && GetWindowsMinorVersion() == 0 && GetWindowsBuildVersion() == 20348;
2829
public static bool IsWindowsNanoServer => IsWindows && (IsNotWindowsIoTCore && GetWindowsInstallationType().Equals("Nano Server", StringComparison.OrdinalIgnoreCase));
2930
public static bool IsWindowsServerCore => IsWindows && GetWindowsInstallationType().Equals("Server Core", StringComparison.OrdinalIgnoreCase);
3031
public static int WindowsVersion => IsWindows ? (int)GetWindowsVersion() : -1;

src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/BidirectionStreamingTest.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ public BidirectionStreamingTest(ITestOutputHelper output) : base(output)
2222

2323
// Build number suggested by the WinHttp team.
2424
// It can be reduced if bidirectional streaming is backported.
25-
public static bool OsSupportsWinHttpBidirectionalStreaming => Environment.OSVersion.Version >= new Version(10, 0, 22357, 0);
25+
public static bool OsSupportsWinHttpBidirectionalStreaming => Environment.OSVersion.Version >= new Version(10, 0, 22357, 0)
26+
|| PlatformDetection.IsWindowsServer2022; // This is required
27+
// because WINHTTP_FLAG_AUTOMATIC_CHUNKING is backported to WS2022.
2628

2729
public static bool TestsEnabled => OsSupportsWinHttpBidirectionalStreaming && PlatformDetection.SupportsAlpn;
2830

@@ -324,7 +326,6 @@ async Task RunServer()
324326
}
325327

326328
[ConditionalFact(nameof(TestsBackwardsCompatibilityEnabled))]
327-
[ActiveIssue("https://github.com/dotnet/runtime/issues/103754")]
328329
public async Task BackwardsCompatibility_DowngradeToHttp11()
329330
{
330331
TaskCompletionSource<object> completeStreamTcs = new TaskCompletionSource<object>(TaskCreationOptions.RunContinuationsAsynchronously);

0 commit comments

Comments
 (0)