From 4e56c2b2fa53beadc24787c023aaa82f28d90ee6 Mon Sep 17 00:00:00 2001 From: Ahmet Ibrahim Aksoy Date: Fri, 12 Jul 2024 16:38:07 +0200 Subject: [PATCH 1/2] Add null check for inboundControlStream on Closing Path --- .../tests/System/Net/Http/Http3LoopbackConnection.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libraries/Common/tests/System/Net/Http/Http3LoopbackConnection.cs b/src/libraries/Common/tests/System/Net/Http/Http3LoopbackConnection.cs index 581bc018a19834..a8e18ae6fce781 100644 --- a/src/libraries/Common/tests/System/Net/Http/Http3LoopbackConnection.cs +++ b/src/libraries/Common/tests/System/Net/Http/Http3LoopbackConnection.cs @@ -315,8 +315,11 @@ public async Task WaitForClientDisconnectAsync(bool refuseNewRequests = true) // The client's control stream should throw QuicConnectionAbortedException, indicating that it was // aborted because the connection was closed (and was not explicitly closed or aborted prior to the connection being closed) - QuicException ex = await Assert.ThrowsAsync(async () => await _inboundControlStream.ReadFrameAsync().ConfigureAwait(false)); - Assert.Equal(QuicError.ConnectionAborted, ex.QuicError); + if (_inboundControlStream is not null) + { + QuicException ex = await Assert.ThrowsAsync(async () => await _inboundControlStream.ReadFrameAsync().ConfigureAwait(false)); + Assert.Equal(QuicError.ConnectionAborted, ex.QuicError); + } await CloseAsync(H3_NO_ERROR).ConfigureAwait(false); } From dbd52552583d59351e90ea122a979e45b1e12786 Mon Sep 17 00:00:00 2001 From: Ahmet Ibrahim Aksoy Date: Fri, 12 Jul 2024 16:39:01 +0200 Subject: [PATCH 2/2] Enable disabled H/3 test --- .../tests/FunctionalTests/DiagnosticsTests.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/DiagnosticsTests.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/DiagnosticsTests.cs index 8da624c76fd865..77b8893318343a 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/DiagnosticsTests.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/DiagnosticsTests.cs @@ -237,12 +237,6 @@ await RemoteExecutor.Invoke(async (useVersion, testAsync) => [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] public async Task SendAsync_ExpectedDiagnosticCancelledLogging() { - if (UseVersion == HttpVersion30) - { - // [ActiveIssue("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/dotnet/runtime/issues/104699")] - throw new SkipTestException("SendAsync_ExpectedDiagnosticCancelledLogging is broken on HTTP/3."); - } - await RemoteExecutor.Invoke(async (useVersion, testAsync) => { TaskCompletionSource responseLoggedTcs = new(TaskCreationOptions.RunContinuationsAsynchronously);