Skip to content

Commit

Permalink
Disable MsQuicTests.CertificateCallbackThrowPropagates test (#99108)
Browse files Browse the repository at this point in the history
* Disable CertificateCallbackThrowPropagates test

* More precise disabling
  • Loading branch information
rzikm authored Feb 29, 2024
1 parent 89f7ad3 commit 028eda8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,10 @@ public async Task UntrustedClientCertificateFails()
}
}

static bool SupportsAsyncCertValidation => QuicTestCollection.MsQuicVersion >= new Version(2, 4);

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/99074", typeof(MsQuicTests), nameof(SupportsAsyncCertValidation))]
public async Task CertificateCallbackThrowPropagates()
{
using CancellationTokenSource cts = new CancellationTokenSource(PassingTestTimeout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@
using Microsoft.Quic;
using static Microsoft.Quic.MsQuic;

namespace System.Net.Quic.Tests;

[CollectionDefinition(nameof(QuicTestCollection), DisableParallelization = true)]
public unsafe class QuicTestCollection : ICollectionFixture<QuicTestCollection>, IDisposable
{
public static bool IsSupported => QuicListener.IsSupported && QuicConnection.IsSupported;

public static Version MsQuicVersion { get; } = GetMsQuicVersion();

public QuicTestCollection()
{
string msQuicLibraryVersion = GetMsQuicLibraryVersion();
Expand Down Expand Up @@ -80,6 +84,13 @@ void DumpCounter(QUIC_PERFORMANCE_COUNTERS counter)
System.Console.WriteLine(sb.ToString());
}

private static Version GetMsQuicVersion()
{
Type msQuicApiType = Type.GetType("System.Net.Quic.MsQuicApi, System.Net.Quic");

return (Version)msQuicApiType.GetProperty("Version", BindingFlags.NonPublic | BindingFlags.Static).GetGetMethod(true).Invoke(null, Array.Empty<object?>());
}

private static string? GetMsQuicLibraryVersion()
{
Type msQuicApiType = Type.GetType("System.Net.Quic.MsQuicApi, System.Net.Quic");
Expand Down

0 comments on commit 028eda8

Please # to comment.