Skip to content

Commit

Permalink
Fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
simonrozsival committed Jul 3, 2024
1 parent de390eb commit a355377
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ private static bool GetAlpnSupport()
}

public static bool SupportsAlpn => s_supportsAlpn.Value;
public static bool SupportsBackendAlpn => SupportsAlpn && !IsAndroid;
public static bool SupportsClientAlpn => SupportsAlpn || IsOSX || IsMacCatalyst || IsiOS || IstvOS;
public static bool SupportsHardLinkCreation => !IsAndroid && !IsLinuxBionic;

Expand Down Expand Up @@ -736,7 +735,7 @@ private static bool DetermineBinaryFormatterSupport()
{
return false;
}

Assembly assembly = typeof(System.Runtime.Serialization.Formatters.Binary.BinaryFormatter).Assembly;
AssemblyName name = assembly.GetName();
Version assemblyVersion = name.Version;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace System.Net.Security.Tests

public abstract class SslStreamAlpnTestBase
{
private static bool BackendSupportsAlpn => PlatformDetection.SupportsBackendAlpn;
private static bool BackendSupportsAlpn => PlatformDetection.SupportsAlpn;
private static bool ClientSupportsAlpn => PlatformDetection.SupportsClientAlpn;
readonly ITestOutputHelper _output;
public static readonly object[][] Http2Servers = Configuration.Http.Http2Servers;
Expand Down Expand Up @@ -154,7 +154,8 @@ public async Task SslStream_StreamToStream_Alpn_NonMatchingProtocols_Fail()
};

// Test ALPN failure only on platforms that supports ALPN.
if (BackendSupportsAlpn)
// On Android, protocol mismatch won't cause an exception, even though it supports ALPN.
if (BackendSupportsAlpn && !OperatingSystem.IsAndroid())
{
Task t1 = Assert.ThrowsAsync<AuthenticationException>(() => clientStream.AuthenticateAsClientAsync(TestAuthenticateAsync, clientOptions));
await Assert.ThrowsAsync<AuthenticationException>(() => serverStream.AuthenticateAsServerAsync(TestAuthenticateAsync, serverOptions).WaitAsync(TestConfiguration.PassingTestTimeout));
Expand Down

0 comments on commit a355377

Please sign in to comment.