Skip to content

Commit

Permalink
Add a dummy test
Browse files Browse the repository at this point in the history
To confirm that CI catches dotnet/runtime#101772
  • Loading branch information
amcasey committed May 1, 2024
1 parent 923b62f commit a3ab3eb
Showing 1 changed file with 36 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
using Microsoft.AspNetCore.Connections;
using Microsoft.AspNetCore.Connections.Features;
using Microsoft.AspNetCore.Internal;
using Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Internal;
using Microsoft.AspNetCore.InternalTesting;
using Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Internal;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Time.Testing;

Expand Down Expand Up @@ -280,6 +280,41 @@ public async Task AcceptAsync_ServerStartsAndStopsUnidirectionStream_ClientAccep
Assert.Equal(0, readCount);
}

[Fact]
public void DoubleCatch()
{
try
{
Logger.LogInformation("Try");
throw new QuicException(QuicError.ConnectionAborted, applicationErrorCode: null, "Message");
}
catch (QuicException ex) when (ex.QuicError == QuicError.ConnectionAborted)
{
Logger.LogInformation("ConnectionAborted");
throw new Exception("Repro failed");
}
catch (QuicException)
{
try
{
Assert.Fail("How did we get here?");
}
finally // Required for repro
{
Assert.Fail("How did we get here?");
}
}
catch (Exception)
{
Logger.LogInformation("Exception");
Assert.Fail("Repro succeeded");
}
finally
{
Logger.LogInformation("Finally");
}
}

[ConditionalFact]
[MsQuicSupported]
public async Task AcceptAsync_ClientClosesConnection_ExceptionThrown()
Expand Down

0 comments on commit a3ab3eb

Please sign in to comment.