Skip to content

Commit a3ab3eb

Browse files
committed
Add a dummy test
To confirm that CI catches dotnet/runtime#101772
1 parent 923b62f commit a3ab3eb

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

src/Servers/Kestrel/Transport.Quic/test/QuicConnectionContextTests.cs

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
using Microsoft.AspNetCore.Connections;
99
using Microsoft.AspNetCore.Connections.Features;
1010
using Microsoft.AspNetCore.Internal;
11-
using Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Internal;
1211
using Microsoft.AspNetCore.InternalTesting;
12+
using Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Internal;
1313
using Microsoft.Extensions.Logging;
1414
using Microsoft.Extensions.Time.Testing;
1515

@@ -280,6 +280,41 @@ public async Task AcceptAsync_ServerStartsAndStopsUnidirectionStream_ClientAccep
280280
Assert.Equal(0, readCount);
281281
}
282282

283+
[Fact]
284+
public void DoubleCatch()
285+
{
286+
try
287+
{
288+
Logger.LogInformation("Try");
289+
throw new QuicException(QuicError.ConnectionAborted, applicationErrorCode: null, "Message");
290+
}
291+
catch (QuicException ex) when (ex.QuicError == QuicError.ConnectionAborted)
292+
{
293+
Logger.LogInformation("ConnectionAborted");
294+
throw new Exception("Repro failed");
295+
}
296+
catch (QuicException)
297+
{
298+
try
299+
{
300+
Assert.Fail("How did we get here?");
301+
}
302+
finally // Required for repro
303+
{
304+
Assert.Fail("How did we get here?");
305+
}
306+
}
307+
catch (Exception)
308+
{
309+
Logger.LogInformation("Exception");
310+
Assert.Fail("Repro succeeded");
311+
}
312+
finally
313+
{
314+
Logger.LogInformation("Finally");
315+
}
316+
}
317+
283318
[ConditionalFact]
284319
[MsQuicSupported]
285320
public async Task AcceptAsync_ClientClosesConnection_ExceptionThrown()

0 commit comments

Comments
 (0)