From e167e37a2a6a7b9b381c462c7ccfd5e653c045e2 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2020 12:04:27 -0800 Subject: [PATCH 01/50] Update dependencies from https://github.com/dotnet/aspnetcore-tooling build 20200221.2 (#19244) Willy --- NuGet.config | 2 +- eng/Version.Details.xml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/NuGet.config b/NuGet.config index 38354139f2..fd18ec518c 100644 --- a/NuGet.config +++ b/NuGet.config @@ -8,7 +8,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b88f275ac6..1c5daf9625 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -15,19 +15,19 @@ https://github.com/dotnet/aspnetcore-tooling - ddaf299d62823582072544164c95a509c9c8a94d + 9554a406369bf913db9ded9987f9db492a69367c https://github.com/dotnet/aspnetcore-tooling - ddaf299d62823582072544164c95a509c9c8a94d + 9554a406369bf913db9ded9987f9db492a69367c https://github.com/dotnet/aspnetcore-tooling - ddaf299d62823582072544164c95a509c9c8a94d + 9554a406369bf913db9ded9987f9db492a69367c https://github.com/dotnet/aspnetcore-tooling - ddaf299d62823582072544164c95a509c9c8a94d + 9554a406369bf913db9ded9987f9db492a69367c https://github.com/dotnet/efcore From c61ecabc6da7470dce6df780e7dabdd3dfe35719 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2020 22:26:40 +0000 Subject: [PATCH 02/50] Update dependencies from https://github.com/dotnet/efcore build 20200225.4 (#19346) - Microsoft.EntityFrameworkCore.Tools - 3.1.3 - Microsoft.EntityFrameworkCore.InMemory - 3.1.3 - Microsoft.EntityFrameworkCore - 3.1.3 - Microsoft.EntityFrameworkCore.Relational - 3.1.3 - Microsoft.EntityFrameworkCore.Sqlite - 3.1.3 - dotnet-ef - 3.1.3 - Microsoft.EntityFrameworkCore.SqlServer - 3.1.3 --- NuGet.config | 2 +- eng/Version.Details.xml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/NuGet.config b/NuGet.config index fd18ec518c..be6e796e6e 100644 --- a/NuGet.config +++ b/NuGet.config @@ -3,7 +3,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 1c5daf9625..94f1ff5ae5 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -31,31 +31,31 @@ https://github.com/dotnet/efcore - 9c83918c225447c4ba9afa9b32958f48997cd929 + 97936e814c52757a9ad128a542d975e3dc9d27f9 https://github.com/dotnet/efcore - 9c83918c225447c4ba9afa9b32958f48997cd929 + 97936e814c52757a9ad128a542d975e3dc9d27f9 https://github.com/dotnet/efcore - 9c83918c225447c4ba9afa9b32958f48997cd929 + 97936e814c52757a9ad128a542d975e3dc9d27f9 https://github.com/dotnet/efcore - 9c83918c225447c4ba9afa9b32958f48997cd929 + 97936e814c52757a9ad128a542d975e3dc9d27f9 https://github.com/dotnet/efcore - 9c83918c225447c4ba9afa9b32958f48997cd929 + 97936e814c52757a9ad128a542d975e3dc9d27f9 https://github.com/dotnet/efcore - 9c83918c225447c4ba9afa9b32958f48997cd929 + 97936e814c52757a9ad128a542d975e3dc9d27f9 https://github.com/dotnet/efcore - 9c83918c225447c4ba9afa9b32958f48997cd929 + 97936e814c52757a9ad128a542d975e3dc9d27f9 https://github.com/dotnet/extensions From 5b7672c2adf9733bb84222dd403725d35b17d835 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Thu, 27 Feb 2020 17:45:39 +1300 Subject: [PATCH 03/50] Handle Http2Streams that error during stream start (#19386) --- .../src/Internal/Http2/Http2Connection.cs | 20 +- .../Core/src/Internal/Http2/Http2Stream.cs | 20 +- .../Http2/Http2ConnectionTests.cs | 197 ++++++++++++++++++ 3 files changed, 227 insertions(+), 10 deletions(-) diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs index 848aca40c7..c3dbfb5d02 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs @@ -65,7 +65,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 private int _gracefulCloseInitiator; private int _isClosed; - private Http2StreamStack _streamPool; + // Internal for testing + internal Http2StreamStack StreamPool; internal const int InitialStreamPoolSize = 5; internal const int MaxStreamPoolSize = 40; @@ -111,7 +112,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 _serverSettings.InitialWindowSize = (uint)http2Limits.InitialStreamWindowSize; // Start pool off at a smaller size if the max number of streams is less than the InitialStreamPoolSize - _streamPool = new Http2StreamStack(Math.Min(InitialStreamPoolSize, http2Limits.MaxStreamsPerConnection)); + StreamPool = new Http2StreamStack(Math.Min(InitialStreamPoolSize, http2Limits.MaxStreamsPerConnection)); _inputTask = ReadInputAsync(); } @@ -572,7 +573,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 private Http2Stream GetStream(IHttpApplication application) { - if (_streamPool.TryPop(out var stream)) + if (StreamPool.TryPop(out var stream)) { stream.InitializeWithExistingContext(_incomingFrame.StreamId); return stream; @@ -606,9 +607,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 private void ReturnStream(Http2Stream stream) { - if (_streamPool.Count < MaxStreamPoolSize) + if (StreamPool.Count < MaxStreamPoolSize) { - _streamPool.Push(stream); + StreamPool.Push(stream); } } @@ -972,8 +973,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 catch (Http2StreamErrorException) { MakeSpaceInDrainQueue(); - // Tracked for draining - _completedStreams.Enqueue(_currentHeadersStream); + + // Because this stream isn't being queued, OnRequestProcessingEnded will not be + // automatically called and the stream won't be completed. + // Manually complete stream to ensure pipes are completed. + // Completing the stream will add it to the completed stream queue. + _currentHeadersStream.DecrementActiveClientStreamCount(); + _currentHeadersStream.CompleteStream(errored: true); throw; } diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs index 7a6b75de8b..7ad02fb966 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs @@ -103,6 +103,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 } protected override void OnRequestProcessingEnded() + { + CompleteStream(errored: false); + } + + public void CompleteStream(bool errored) { try { @@ -110,14 +115,23 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 // If the app finished without reading the request body tell the client not to finish sending it. if (!EndStreamReceived && !RstStreamReceived) { - Log.RequestBodyNotEntirelyRead(ConnectionIdFeature, TraceIdentifier); + if (!errored) + { + Log.RequestBodyNotEntirelyRead(ConnectionIdFeature, TraceIdentifier); + } var (oldState, newState) = ApplyCompletionFlag(StreamCompletionFlags.Aborted); if (oldState != newState) { Debug.Assert(_decrementCalled); - // Don't block on IO. This never faults. - _ = _http2Output.WriteRstStreamAsync(Http2ErrorCode.NO_ERROR); + + // If there was an error starting the stream then we don't want to write RST_STREAM here. + // The connection will handle writing RST_STREAM with the correct error code. + if (!errored) + { + // Don't block on IO. This never faults. + _ = _http2Output.WriteRstStreamAsync(Http2ErrorCode.NO_ERROR); + } RequestBodyPipe.Writer.Complete(); } } diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs index 9814918386..857c9a3e96 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs @@ -14,6 +14,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Connections; using Microsoft.AspNetCore.Server.Kestrel.Core.Features; using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Logging; using Microsoft.Net.Http.Headers; @@ -24,6 +25,202 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests { public class Http2ConnectionTests : Http2TestBase { + [Fact] + public async Task StreamPool_SingleStream_ReturnedToPool() + { + await InitializeConnectionAsync(_echoApplication); + + Assert.Equal(0, _connection.StreamPool.Count); + + await StartStreamAsync(1, _browserRequestHeaders, endStream: true); + + await ExpectAsync(Http2FrameType.HEADERS, + withLength: 55, + withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), + withStreamId: 1); + + // Ping will trigger the stream to be returned to the pool so we can assert it + await SendPingAsync(Http2PingFrameFlags.NONE); + await ExpectAsync(Http2FrameType.PING, + withLength: 8, + withFlags: (byte)Http2PingFrameFlags.ACK, + withStreamId: 0); + + // Stream has been returned to the pool + Assert.Equal(1, _connection.StreamPool.Count); + + await StopConnectionAsync(expectedLastStreamId: 1, ignoreNonGoAwayFrames: false); + } + + [Fact] + public async Task StreamPool_MultipleStreamsConcurrent_StreamsReturnedToPool() + { + await InitializeConnectionAsync(_echoApplication); + + Assert.Equal(0, _connection.StreamPool.Count); + + await StartStreamAsync(1, _browserRequestHeaders, endStream: false); + await StartStreamAsync(3, _browserRequestHeaders, endStream: false); + + await SendDataAsync(1, _helloBytes, endStream: true); + + await ExpectAsync(Http2FrameType.HEADERS, + withLength: 37, + withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, + withStreamId: 1); + await ExpectAsync(Http2FrameType.DATA, + withLength: 5, + withFlags: (byte)Http2DataFrameFlags.NONE, + withStreamId: 1); + await ExpectAsync(Http2FrameType.DATA, + withLength: 0, + withFlags: (byte)Http2DataFrameFlags.END_STREAM, + withStreamId: 1); + + await SendDataAsync(3, _helloBytes, endStream: true); + + await ExpectAsync(Http2FrameType.HEADERS, + withLength: 37, + withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, + withStreamId: 3); + await ExpectAsync(Http2FrameType.DATA, + withLength: 5, + withFlags: (byte)Http2DataFrameFlags.NONE, + withStreamId: 3); + await ExpectAsync(Http2FrameType.DATA, + withLength: 0, + withFlags: (byte)Http2DataFrameFlags.END_STREAM, + withStreamId: 3); + + // Ping will trigger the stream to be returned to the pool so we can assert it + await SendPingAsync(Http2PingFrameFlags.NONE); + await ExpectAsync(Http2FrameType.PING, + withLength: 8, + withFlags: (byte)Http2PingFrameFlags.ACK, + withStreamId: 0); + + // Streams have been returned to the pool + Assert.Equal(2, _connection.StreamPool.Count); + + await StopConnectionAsync(expectedLastStreamId: 3, ignoreNonGoAwayFrames: false); + } + + [Fact] + public async Task StreamPool_MultipleStreamsInSequence_PooledStreamReused() + { + await InitializeConnectionAsync(_echoApplication); + + Assert.Equal(0, _connection.StreamPool.Count); + + await StartStreamAsync(1, _browserRequestHeaders, endStream: true); + + await ExpectAsync(Http2FrameType.HEADERS, + withLength: 55, + withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), + withStreamId: 1); + + // Ping will trigger the stream to be returned to the pool so we can assert it + await SendPingAsync(Http2PingFrameFlags.NONE); + await ExpectAsync(Http2FrameType.PING, + withLength: 8, + withFlags: (byte)Http2PingFrameFlags.ACK, + withStreamId: 0); + + // Stream has been returned to the pool + Assert.Equal(1, _connection.StreamPool.Count); + + await StartStreamAsync(3, _browserRequestHeaders, endStream: true); + + await ExpectAsync(Http2FrameType.HEADERS, + withLength: 55, + withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), + withStreamId: 3); + + // New stream has been taken from the pool + Assert.Equal(0, _connection.StreamPool.Count); + + // Ping will trigger the stream to be returned to the pool so we can assert it + await SendPingAsync(Http2PingFrameFlags.NONE); + await ExpectAsync(Http2FrameType.PING, + withLength: 8, + withFlags: (byte)Http2PingFrameFlags.ACK, + withStreamId: 0); + + // Stream was reused and returned to the pool + Assert.Equal(1, _connection.StreamPool.Count); + + await StopConnectionAsync(expectedLastStreamId: 3, ignoreNonGoAwayFrames: false); + } + + [Fact] + public async Task StreamPool_EndedStreamErrorsOnStart_ReturnedToPool() + { + await InitializeConnectionAsync(_echoApplication); + + _connection.ServerSettings.MaxConcurrentStreams = 1; + + await StartStreamAsync(1, _browserRequestHeaders, endStream: false); + + // This stream will error because it exceeds max concurrent streams + await StartStreamAsync(3, _browserRequestHeaders, endStream: true); + await WaitForStreamErrorAsync(3, Http2ErrorCode.REFUSED_STREAM, CoreStrings.Http2ErrorMaxStreams); + + // Ping will trigger the stream to be returned to the pool so we can assert it + await SendPingAsync(Http2PingFrameFlags.NONE); + await ExpectAsync(Http2FrameType.PING, + withLength: 8, + withFlags: (byte)Http2PingFrameFlags.ACK, + withStreamId: 0); + + // Stream returned to the pool + Assert.Equal(1, _connection.StreamPool.Count); + + Assert.True(_connection.StreamPool.TryPop(out var stream)); + + // Stream has been completed and reset before being returned + Assert.Empty(stream.RequestHeaders); + + await StopConnectionAsync(expectedLastStreamId: 3, ignoreNonGoAwayFrames: false); + } + + [Fact] + public async Task StreamPool_UnendedStreamErrorsOnStart_ReturnedToPool() + { + _serviceContext.ServerOptions.Limits.MinRequestBodyDataRate = null; + + await InitializeConnectionAsync(_echoApplication); + + _connection.ServerSettings.MaxConcurrentStreams = 1; + + await StartStreamAsync(1, _browserRequestHeaders, endStream: false); + + // This stream will error because it exceeds max concurrent streams + await StartStreamAsync(3, _browserRequestHeaders, endStream: false); + await WaitForStreamErrorAsync(3, Http2ErrorCode.REFUSED_STREAM, CoreStrings.Http2ErrorMaxStreams); + + // Ping will trigger the stream to be returned to the pool so we can assert it + await SendPingAsync(Http2PingFrameFlags.NONE); + await ExpectAsync(Http2FrameType.PING, + withLength: 8, + withFlags: (byte)Http2PingFrameFlags.ACK, + withStreamId: 0); + + AdvanceClock(TimeSpan.FromTicks(Constants.RequestBodyDrainTimeout.Ticks + 1)); + + // Ping will trigger the stream to attempt to be returned to the pool + await SendPingAsync(Http2PingFrameFlags.NONE); + await ExpectAsync(Http2FrameType.PING, + withLength: 8, + withFlags: (byte)Http2PingFrameFlags.ACK, + withStreamId: 0); + + // Stream was returned to the pool because of the drain timeout + Assert.Equal(1, _connection.StreamPool.Count); + + await StopConnectionAsync(expectedLastStreamId: 3, ignoreNonGoAwayFrames: false); + + } + [Fact] public async Task Frame_Received_OverMaxSize_FrameError() { From 2056146c951891a082d8e55d5c4d66212673462f Mon Sep 17 00:00:00 2001 From: Brennan Date: Thu, 27 Feb 2020 08:27:48 -0800 Subject: [PATCH 04/50] Fix flaky timeout test in TS client (#19389) --- .../clients/ts/FunctionalTests/ts/HubConnectionTests.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/SignalR/clients/ts/FunctionalTests/ts/HubConnectionTests.ts b/src/SignalR/clients/ts/FunctionalTests/ts/HubConnectionTests.ts index 61b43e0654..93275f5336 100644 --- a/src/SignalR/clients/ts/FunctionalTests/ts/HubConnectionTests.ts +++ b/src/SignalR/clients/ts/FunctionalTests/ts/HubConnectionTests.ts @@ -679,7 +679,6 @@ describe("hubConnection", () => { if (transportType !== HttpTransportType.LongPolling) { it("terminates if no messages received within timeout interval", async (done) => { const hubConnection = getConnectionBuilder(transportType).build(); - hubConnection.serverTimeoutInMilliseconds = 100; hubConnection.onclose((error) => { expect(error).toEqual(new Error("Server timeout elapsed without receiving a message from the server.")); @@ -687,6 +686,12 @@ describe("hubConnection", () => { }); await hubConnection.start(); + + // set this after start completes to avoid network issues with the handshake taking over 100ms and causing a failure + hubConnection.serverTimeoutInMilliseconds = 1; + + // invoke a method with a response to reset the timeout using the new value + await hubConnection.invoke("Echo", ""); }); } From 403bdaa1a6144d791c8ca38c112c39c7e51def17 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2020 18:05:09 +0000 Subject: [PATCH 05/50] Update dependencies from https://github.com/dotnet/arcade build 20200226.7 (#19406) - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20126.7 - Microsoft.DotNet.GenAPI - 5.0.0-beta.20126.7 - Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20126.7 --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 2 +- .../post-build/channels/generic-internal-channel.yml | 1 + .../post-build/channels/generic-public-channel.yml | 1 + global.json | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 97d0e39129..38a90d664d 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -336,17 +336,17 @@ https://github.com/dotnet/extensions 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 - + https://github.com/dotnet/arcade - 85d76351b1f0245c9f331f72219d12e8e2d48e72 + cd4164e1f3f7daf2a6f8dbd012210c93521bd82f - + https://github.com/dotnet/arcade - 85d76351b1f0245c9f331f72219d12e8e2d48e72 + cd4164e1f3f7daf2a6f8dbd012210c93521bd82f - + https://github.com/dotnet/arcade - 85d76351b1f0245c9f331f72219d12e8e2d48e72 + cd4164e1f3f7daf2a6f8dbd012210c93521bd82f https://github.com/dotnet/extensions diff --git a/eng/Versions.props b/eng/Versions.props index 94653236df..d829874c3e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -62,7 +62,7 @@ --> - 5.0.0-beta.20123.1 + 5.0.0-beta.20126.7 3.5.0-beta4-20125-04 diff --git a/eng/common/templates/post-build/channels/generic-internal-channel.yml b/eng/common/templates/post-build/channels/generic-internal-channel.yml index 380122901d..dde27800c3 100644 --- a/eng/common/templates/post-build/channels/generic-internal-channel.yml +++ b/eng/common/templates/post-build/channels/generic-internal-channel.yml @@ -84,6 +84,7 @@ stages: - job: publish_assets displayName: Publish Assets dependsOn: setupMaestroVars + timeoutInMinutes: 120 variables: - name: BARBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] diff --git a/eng/common/templates/post-build/channels/generic-public-channel.yml b/eng/common/templates/post-build/channels/generic-public-channel.yml index 00ef36fefe..29bc1a941a 100644 --- a/eng/common/templates/post-build/channels/generic-public-channel.yml +++ b/eng/common/templates/post-build/channels/generic-public-channel.yml @@ -83,6 +83,7 @@ stages: - job: publish_assets displayName: Publish Assets dependsOn: setupMaestroVars + timeoutInMinutes: 120 variables: - name: BARBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] diff --git a/global.json b/global.json index 9d9a073328..690fcfbd34 100644 --- a/global.json +++ b/global.json @@ -25,7 +25,7 @@ }, "msbuild-sdks": { "Yarn.MSBuild": "1.15.2", - "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20123.1", - "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20123.1" + "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20126.7", + "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20126.7" } } From 6e9a786dfcc4d35c39dd786e83117c0259c33dd2 Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Thu, 27 Feb 2020 11:50:14 -0800 Subject: [PATCH 06/50] Mark Http/3 test as flaky (#19411) * Mark Http/3 test as flaky Not sure why this test is failing, will debug in https://github.com/dotnet/aspnetcore/pull/19385 * Update Http3StreamTests.cs --- .../test/InMemory.FunctionalTests/Http3/Http3StreamTests.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3StreamTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3StreamTests.cs index 860caa46c0..ac206bcaa4 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3StreamTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3StreamTests.cs @@ -5,6 +5,7 @@ using System.Net.Http; using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Http.Features; +using Microsoft.AspNetCore.Testing; using Microsoft.Net.Http.Headers; using Xunit; @@ -263,6 +264,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests } [Fact] + [Flaky("", FlakyOn.All)] public async Task MissingAuthority_200Status() { var headers = new[] From 52c497aa309837eaef38122b8d6f1f0df53aca24 Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Wed, 26 Feb 2020 19:18:37 -0800 Subject: [PATCH 07/50] Add parser and formatter for short types --- .../Components/src/BindConverter.cs | 118 +++++++++++++++++- 1 file changed, 117 insertions(+), 1 deletion(-) diff --git a/src/Components/Components/src/BindConverter.cs b/src/Components/Components/src/BindConverter.cs index 30ded5fe73..0aadb8077e 100644 --- a/src/Components/Components/src/BindConverter.cs +++ b/src/Components/Components/src/BindConverter.cs @@ -15,7 +15,7 @@ namespace Microsoft.AspNetCore.Components // // Perf: our conversion routines present a regular API surface that allows us to specialize on types to avoid boxing. // for instance, many of these types could be cast to IFormattable to do the appropriate formatting, but that's going - // to allocate. + // to allocate. public static class BindConverter { private static object BoxedTrue = true; @@ -158,6 +158,41 @@ namespace Microsoft.AspNetCore.Components return value.Value.ToString(culture ?? CultureInfo.CurrentCulture); } + /// + /// Formats the provided for inclusion in an attribute. + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(short value, CultureInfo culture = null) => FormatShortValueCore(value, culture); + + private static string FormatShortValueCore(short value, CultureInfo culture) + { + return value.ToString(culture ?? CultureInfo.CurrentCulture); + } + + /// + /// Formats the provided for inclusion in an attribute. + /// + /// The value to format. + /// + /// The to use while formatting. Defaults to . + /// + /// The formatted value. + public static string FormatValue(short? value, CultureInfo culture = null) => FormatNullableShortValueCore(value, culture); + + private static string FormatNullableShortValueCore(short? value, CultureInfo culture) + { + if (value == null) + { + return null; + } + + return value.Value.ToString(culture ?? CultureInfo.CurrentCulture); + } + /// /// Formats the provided for inclusion in an attribute. /// @@ -649,6 +684,71 @@ namespace Microsoft.AspNetCore.Components return true; } + /// + /// Attempts to convert a value to a . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToShort(object obj, CultureInfo culture, out short value) + { + return ConvertToShortCore(obj, culture, out value); + } + + /// + /// Attempts to convert a value to a nullable . + /// + /// The object to convert. + /// The to use for conversion. + /// The converted value. + /// true if conversion is successful, otherwise false. + public static bool TryConvertToNullableShort(object obj, CultureInfo culture, out short? value) + { + return ConvertToNullableShort(obj, culture, out value); + } + + internal static BindParser ConvertToShort = ConvertToShortCore; + internal static BindParser ConvertToNullableShort = ConvertToNullableShortCore; + + private static bool ConvertToShortCore(object obj, CultureInfo culture, out short value) + { + var text = (string)obj; + if (string.IsNullOrEmpty(text)) + { + value = default; + return false; + } + + if (!short.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) + { + value = default; + return false; + } + + value = converted; + return true; + } + + private static bool ConvertToNullableShortCore(object obj, CultureInfo culture, out short? value) + { + var text = (string)obj; + if (string.IsNullOrEmpty(text)) + { + value = default; + return true; + } + + if (!short.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) + { + value = default; + return false; + } + + value = converted; + return true; + } + /// /// Attempts to convert a value to a . /// @@ -1198,6 +1298,14 @@ namespace Microsoft.AspNetCore.Components { formatter = (BindFormatter)FormatNullableLongValueCore; } + else if (typeof(T) == typeof(short)) + { + formatter = (BindFormatter)FormatShortValueCore; + } + else if (typeof(T) == typeof(short?)) + { + formatter = (BindFormatter)FormatNullableShortValueCore; + } else if (typeof(T) == typeof(float)) { formatter = (BindFormatter)FormatFloatValueCore; @@ -1323,6 +1431,14 @@ namespace Microsoft.AspNetCore.Components { parser = ConvertToNullableLong; } + else if (typeof(T) == typeof(short)) + { + parser = ConvertToShort; + } + else if (typeof(T) == typeof(short?)) + { + parser = ConvertToNullableShort; + } else if (typeof(T) == typeof(float)) { parser = ConvertToFloat; From 346eceaadb90ca5c2985f0982c97b07764d4f9c0 Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Wed, 26 Feb 2020 19:55:05 -0800 Subject: [PATCH 08/50] Add two-way binding for short data types --- .../EventCallbackFactoryBinderExtensions.cs | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/Components/Components/src/EventCallbackFactoryBinderExtensions.cs b/src/Components/Components/src/EventCallbackFactoryBinderExtensions.cs index 2a27533dfb..0305c1b469 100644 --- a/src/Components/Components/src/EventCallbackFactoryBinderExtensions.cs +++ b/src/Components/Components/src/EventCallbackFactoryBinderExtensions.cs @@ -136,6 +136,25 @@ namespace Microsoft.AspNetCore.Components return CreateBinderCore(factory, receiver, setter, culture, ConvertToLong); } + /// + /// For internal use only. + /// + /// + /// + /// + /// + /// + /// + public static EventCallback CreateBinder( + this EventCallbackFactory factory, + object receiver, + Action setter, + short existingValue, + CultureInfo culture = null) + { + return CreateBinderCore(factory, receiver, setter, culture, ConvertToShort); + } + /// /// For internal use only. /// @@ -155,6 +174,25 @@ namespace Microsoft.AspNetCore.Components return CreateBinderCore(factory, receiver, setter, culture, ConvertToNullableLong); } + /// + /// For internal use only. + /// + /// + /// + /// + /// + /// + /// + public static EventCallback CreateBinder( + this EventCallbackFactory factory, + object receiver, + Action setter, + short? existingValue, + CultureInfo culture = null) + { + return CreateBinderCore(factory, receiver, setter, culture, ConvertToNullableShort); + } + /// /// For internal use only. /// From 8a0be19abe1007b4c1bc38eeba9ca0f3b27811b6 Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Wed, 26 Feb 2020 19:55:29 -0800 Subject: [PATCH 09/50] Support short values in --- src/Components/Web/src/Forms/InputNumber.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Components/Web/src/Forms/InputNumber.cs b/src/Components/Web/src/Forms/InputNumber.cs index 09327bcae6..efdb53c905 100644 --- a/src/Components/Web/src/Forms/InputNumber.cs +++ b/src/Components/Web/src/Forms/InputNumber.cs @@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Components.Forms { /// /// An input component for editing numeric values. - /// Supported numeric types are , , , , . + /// Supported numeric types are , , , , , . /// public class InputNumber : InputBase { @@ -22,6 +22,7 @@ namespace Microsoft.AspNetCore.Components.Forms var targetType = Nullable.GetUnderlyingType(typeof(TValue)) ?? typeof(TValue); if (targetType == typeof(int) || targetType == typeof(long) || + targetType == typeof(short) || targetType == typeof(float) || targetType == typeof(double) || targetType == typeof(decimal)) @@ -86,6 +87,9 @@ namespace Microsoft.AspNetCore.Components.Forms case long @long: return BindConverter.FormatValue(@long, CultureInfo.InvariantCulture); + case short @short: + return BindConverter.FormatValue(@short, CultureInfo.InvariantCulture); + case float @float: return BindConverter.FormatValue(@float, CultureInfo.InvariantCulture); From c1158b67185fdf540d88af91feb305039639fb3e Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Wed, 26 Feb 2020 20:07:38 -0800 Subject: [PATCH 10/50] Add tests for short values in --- .../ServerExecutionTests/GlobalizationTest.cs | 12 ++++++++++++ .../BasicTestApp/GlobalizationBindCases.razor | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/src/Components/test/E2ETest/ServerExecutionTests/GlobalizationTest.cs b/src/Components/test/E2ETest/ServerExecutionTests/GlobalizationTest.cs index 3e330f7b47..609fd83f30 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/GlobalizationTest.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/GlobalizationTest.cs @@ -186,6 +186,18 @@ namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests Browser.Equal(90000000000.ToString(cultureInfo), () => display.Text); Browser.Equal(90000000000.ToString(CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + // short + input = Browser.FindElement(By.Id("inputnumber_short")); + display = Browser.FindElement(By.Id("inputnumber_short_value")); + Browser.Equal(42.ToString(cultureInfo), () => display.Text); + Browser.Equal(42.ToString(CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + + input.Clear(); + input.SendKeys(127.ToString(CultureInfo.InvariantCulture)); + input.SendKeys("\t"); + Browser.Equal(127.ToString(cultureInfo), () => display.Text); + Browser.Equal(127.ToString(CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + // decimal input = Browser.FindElement(By.Id("inputnumber_decimal")); display = Browser.FindElement(By.Id("inputnumber_decimal_value")); diff --git a/src/Components/test/testassets/BasicTestApp/GlobalizationBindCases.razor b/src/Components/test/testassets/BasicTestApp/GlobalizationBindCases.razor index 5294f2b1df..04b93ea0d3 100644 --- a/src/Components/test/testassets/BasicTestApp/GlobalizationBindCases.razor +++ b/src/Components/test/testassets/BasicTestApp/GlobalizationBindCases.razor @@ -66,6 +66,10 @@ long: @inputNumberLong +
+ short: + @inputNumberShort +
decimal: @inputNumberDecimal @@ -104,6 +108,7 @@ int inputNumberInt = 42; long inputNumberLong = 4200; + short inputNumberShort = 42; decimal inputNumberDecimal = 4.2m; DateTime inputDateDateTime = new DateTime(1985, 3, 4); From 1407d9ab057098acf5104d39e7de4eb4c08d689b Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Wed, 26 Feb 2020 21:34:28 -0800 Subject: [PATCH 11/50] Update reference assemblies for modified components --- .../ref/Microsoft.AspNetCore.Components.netcoreapp.cs | 6 ++++++ .../ref/Microsoft.AspNetCore.Components.netstandard2.0.cs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/Components/Components/ref/Microsoft.AspNetCore.Components.netcoreapp.cs b/src/Components/Components/ref/Microsoft.AspNetCore.Components.netcoreapp.cs index 10a26b70af..17c4d7a4f5 100644 --- a/src/Components/Components/ref/Microsoft.AspNetCore.Components.netcoreapp.cs +++ b/src/Components/Components/ref/Microsoft.AspNetCore.Components.netcoreapp.cs @@ -12,6 +12,7 @@ namespace Microsoft.AspNetCore.Components public static string FormatValue(System.DateTimeOffset value, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(decimal value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(double value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(short value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(int value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(long value, System.Globalization.CultureInfo culture = null) { throw null; } public static bool? FormatValue(bool? value, System.Globalization.CultureInfo culture = null) { throw null; } @@ -21,6 +22,7 @@ namespace Microsoft.AspNetCore.Components public static string FormatValue(System.DateTime? value, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(decimal? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(double? value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(short? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(int? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(long? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(float? value, System.Globalization.CultureInfo culture = null) { throw null; } @@ -47,6 +49,8 @@ namespace Microsoft.AspNetCore.Components public static bool TryConvertToNullableFloat(object obj, System.Globalization.CultureInfo culture, out float? value) { throw null; } public static bool TryConvertToNullableInt(object obj, System.Globalization.CultureInfo culture, out int? value) { throw null; } public static bool TryConvertToNullableLong(object obj, System.Globalization.CultureInfo culture, out long? value) { throw null; } + public static bool TryConvertToNullableShort(object obj, System.Globalization.CultureInfo culture, out short? value) { throw null; } + public static bool TryConvertToShort(object obj, System.Globalization.CultureInfo culture, out short value) { throw null; } public static bool TryConvertToString(object obj, System.Globalization.CultureInfo culture, out string value) { throw null; } public static bool TryConvertTo(object obj, System.Globalization.CultureInfo culture, out T value) { throw null; } } @@ -165,6 +169,7 @@ namespace Microsoft.AspNetCore.Components public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, System.DateTime existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, decimal existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, double existingValue, System.Globalization.CultureInfo culture = null) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, short existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, int existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, long existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, bool? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } @@ -174,6 +179,7 @@ namespace Microsoft.AspNetCore.Components public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, System.DateTime? existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, decimal? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, double? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, short? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, int? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, long? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, float? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } diff --git a/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.cs b/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.cs index 10a26b70af..17c4d7a4f5 100644 --- a/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.cs +++ b/src/Components/Components/ref/Microsoft.AspNetCore.Components.netstandard2.0.cs @@ -12,6 +12,7 @@ namespace Microsoft.AspNetCore.Components public static string FormatValue(System.DateTimeOffset value, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(decimal value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(double value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(short value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(int value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(long value, System.Globalization.CultureInfo culture = null) { throw null; } public static bool? FormatValue(bool? value, System.Globalization.CultureInfo culture = null) { throw null; } @@ -21,6 +22,7 @@ namespace Microsoft.AspNetCore.Components public static string FormatValue(System.DateTime? value, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(decimal? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(double? value, System.Globalization.CultureInfo culture = null) { throw null; } + public static string FormatValue(short? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(int? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(long? value, System.Globalization.CultureInfo culture = null) { throw null; } public static string FormatValue(float? value, System.Globalization.CultureInfo culture = null) { throw null; } @@ -47,6 +49,8 @@ namespace Microsoft.AspNetCore.Components public static bool TryConvertToNullableFloat(object obj, System.Globalization.CultureInfo culture, out float? value) { throw null; } public static bool TryConvertToNullableInt(object obj, System.Globalization.CultureInfo culture, out int? value) { throw null; } public static bool TryConvertToNullableLong(object obj, System.Globalization.CultureInfo culture, out long? value) { throw null; } + public static bool TryConvertToNullableShort(object obj, System.Globalization.CultureInfo culture, out short? value) { throw null; } + public static bool TryConvertToShort(object obj, System.Globalization.CultureInfo culture, out short value) { throw null; } public static bool TryConvertToString(object obj, System.Globalization.CultureInfo culture, out string value) { throw null; } public static bool TryConvertTo(object obj, System.Globalization.CultureInfo culture, out T value) { throw null; } } @@ -165,6 +169,7 @@ namespace Microsoft.AspNetCore.Components public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, System.DateTime existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, decimal existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, double existingValue, System.Globalization.CultureInfo culture = null) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, short existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, int existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, long existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, bool? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } @@ -174,6 +179,7 @@ namespace Microsoft.AspNetCore.Components public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, System.DateTime? existingValue, string format, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, decimal? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, double? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, short? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, int? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, long? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, float? existingValue, System.Globalization.CultureInfo culture = null) { throw null; } From 677a1b5be7c9676634e0b9a95c510f1bb6e1ad93 Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Thu, 27 Feb 2020 09:23:29 -0800 Subject: [PATCH 12/50] Add tests for short values in BindTests --- src/Components/test/E2ETest/Tests/BindTest.cs | 59 +++++++++++++++++++ .../BasicTestApp/BindCasesComponent.razor | 14 +++++ 2 files changed, 73 insertions(+) diff --git a/src/Components/test/E2ETest/Tests/BindTest.cs b/src/Components/test/E2ETest/Tests/BindTest.cs index cefd842022..70fc700e89 100644 --- a/src/Components/test/E2ETest/Tests/BindTest.cs +++ b/src/Components/test/E2ETest/Tests/BindTest.cs @@ -355,6 +355,65 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Tests Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); } + [Fact] + public void CanBindTextboxShort() + { + var target = Browser.FindElement(By.Id("textbox-short")); + var boundValue = Browser.FindElement(By.Id("textbox-short-value")); + var mirrorValue = Browser.FindElement(By.Id("textbox-short-mirror")); + Assert.Equal("-42", target.GetAttribute("value")); + Assert.Equal("-42", boundValue.Text); + Assert.Equal("-42", mirrorValue.GetAttribute("value")); + + // Clear target; value resets to zero + target.Clear(); + Browser.Equal("0", () => target.GetAttribute("value")); + Assert.Equal("0", boundValue.Text); + Assert.Equal("0", mirrorValue.GetAttribute("value")); + + // Modify target; verify value is updated and that textboxes linked to the same data are updated + // Leading zeros are not preserved + target.SendKeys("42"); + Browser.Equal("042", () => target.GetAttribute("value")); + target.SendKeys("\t"); + Browser.Equal("42", () => target.GetAttribute("value")); + Assert.Equal("42", boundValue.Text); + Assert.Equal("42", mirrorValue.GetAttribute("value")); + } + + [Fact] + public void CanBindTextboxNullableShort() + { + var target = Browser.FindElement(By.Id("textbox-nullable-short")); + var boundValue = Browser.FindElement(By.Id("textbox-nullable-short-value")); + var mirrorValue = Browser.FindElement(By.Id("textbox-nullable-short-mirror")); + Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, boundValue.Text); + Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + + // Modify target; verify value is updated and that textboxes linked to the same data are updated + target.Clear(); + Browser.Equal("", () => boundValue.Text); + Assert.Equal("", mirrorValue.GetAttribute("value")); + + // Modify target; verify value is updated and that textboxes linked to the same data are updated + target.SendKeys("-42\t"); + Browser.Equal("-42", () => boundValue.Text); + Assert.Equal("-42", mirrorValue.GetAttribute("value")); + + // Modify target; verify value is updated and that textboxes linked to the same data are updated + target.Clear(); + target.SendKeys("42\t"); + Browser.Equal("42", () => boundValue.Text); + Assert.Equal("42", mirrorValue.GetAttribute("value")); + + // Modify target; verify value is updated and that textboxes linked to the same data are updated + target.Clear(); + target.SendKeys("\t"); + Browser.Equal(string.Empty, () => boundValue.Text); + Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + } + [Fact] public void CanBindTextboxFloat() { diff --git a/src/Components/test/testassets/BasicTestApp/BindCasesComponent.razor b/src/Components/test/testassets/BasicTestApp/BindCasesComponent.razor index 45d5eacdcc..217c8dc65a 100644 --- a/src/Components/test/testassets/BasicTestApp/BindCasesComponent.razor +++ b/src/Components/test/testassets/BasicTestApp/BindCasesComponent.razor @@ -50,6 +50,18 @@ @textboxNullableLongValue

+

+ short: + + @textboxLongValue + +

+

+ Nullable short: + + @textboxNullableShortValue + +

float: @@ -328,6 +340,8 @@ int? textboxNullableIntValue = null; long textboxLongValue = 3_000_000_000; long? textboxNullableLongValue = null; + short textboxShortValue = -42; + short? textboxNullableShortValue = null; float textboxFloatValue = 3.141f; float? textboxNullableFloatValue = null; double textboxDoubleValue = 3.14159265359d; From f0ac5b07eeb49364db1e51706b84d27a70d9c9f2 Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Thu, 27 Feb 2020 10:14:57 -0800 Subject: [PATCH 13/50] Fix copy/paste type in test asset --- .../test/testassets/BasicTestApp/BindCasesComponent.razor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/test/testassets/BasicTestApp/BindCasesComponent.razor b/src/Components/test/testassets/BasicTestApp/BindCasesComponent.razor index 217c8dc65a..fafd59d49b 100644 --- a/src/Components/test/testassets/BasicTestApp/BindCasesComponent.razor +++ b/src/Components/test/testassets/BasicTestApp/BindCasesComponent.razor @@ -53,7 +53,7 @@

short: - @textboxLongValue + @textboxShortValue

From a2169c228ed20b4c9e67c74c02f67710443e7ef8 Mon Sep 17 00:00:00 2001 From: Kevin Pilch Date: Thu, 27 Feb 2020 16:50:45 -0800 Subject: [PATCH 14/50] Add note about environment on WSL (#19422) --- docs/BuildFromSource.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/BuildFromSource.md b/docs/BuildFromSource.md index 5ab42b0ec7..3fc873b939 100644 --- a/docs/BuildFromSource.md +++ b/docs/BuildFromSource.md @@ -139,6 +139,11 @@ source activate.sh code . ``` +Note that if you are using the "Remote-WSL" extension in VSCode, the environment is not supplied +to the process in WSL. You can workaround this by explicitly setting the environment variables +in `~/.vscode-server/server-env-setup`. +See https://code.visualstudio.com/docs/remote/wsl#_advanced-environment-setup-script for details. + ## Building on command-line You can also build the entire project on command line with the `build.cmd`/`.sh` scripts. From ce0579255104f6ea1902b62c1e21195a7b93f828 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 28 Feb 2020 00:54:31 +0000 Subject: [PATCH 15/50] [master] Update dependencies from dotnet/aspnetcore-tooling (#19412) * Update dependencies from https://github.com/dotnet/aspnetcore-tooling build 20200227.5 - Microsoft.AspNetCore.Mvc.Razor.Extensions - 5.0.0-preview.2.20127.5 - Microsoft.AspNetCore.Razor.Language - 5.0.0-preview.2.20127.5 - Microsoft.CodeAnalysis.Razor - 5.0.0-preview.2.20127.5 - Microsoft.NET.Sdk.Razor - 5.0.0-preview.2.20127.5 * Update dependencies from https://github.com/dotnet/aspnetcore-tooling build 20200227.6 - Microsoft.AspNetCore.Mvc.Razor.Extensions - 5.0.0-preview.2.20127.6 - Microsoft.AspNetCore.Razor.Language - 5.0.0-preview.2.20127.6 - Microsoft.CodeAnalysis.Razor - 5.0.0-preview.2.20127.6 - Microsoft.NET.Sdk.Razor - 5.0.0-preview.2.20127.6 --- eng/Version.Details.xml | 16 ++++++++-------- eng/Versions.props | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 38a90d664d..b38bbf83cf 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -13,21 +13,21 @@ https://github.com/dotnet/blazor dd7fb4d3931d556458f62642c2edfc59f6295bfb - + https://github.com/dotnet/aspnetcore-tooling - 151c6a416f147c687c61dcb9b8cf3f6bd0c1a79f + 01654d8439f104a37bd8992ad3d31c596821806f - + https://github.com/dotnet/aspnetcore-tooling - 151c6a416f147c687c61dcb9b8cf3f6bd0c1a79f + 01654d8439f104a37bd8992ad3d31c596821806f - + https://github.com/dotnet/aspnetcore-tooling - 151c6a416f147c687c61dcb9b8cf3f6bd0c1a79f + 01654d8439f104a37bd8992ad3d31c596821806f - + https://github.com/dotnet/aspnetcore-tooling - 151c6a416f147c687c61dcb9b8cf3f6bd0c1a79f + 01654d8439f104a37bd8992ad3d31c596821806f https://github.com/dotnet/efcore diff --git a/eng/Versions.props b/eng/Versions.props index d829874c3e..7b47b96873 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -149,10 +149,10 @@ 5.0.0-preview.2.20126.1 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 + 5.0.0-preview.2.20127.6 + 5.0.0-preview.2.20127.6 + 5.0.0-preview.2.20127.6 + 5.0.0-preview.2.20127.6 + true From f8f747216154441d7c9054b16154a15e4bc46de6 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Sat, 29 Feb 2020 09:31:55 +1300 Subject: [PATCH 18/50] Fix flaky stream pool test (#19425) --- .../Http2/Http2ConnectionTests.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs index 857c9a3e96..b0007a6a0d 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs @@ -108,12 +108,20 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests [Fact] public async Task StreamPool_MultipleStreamsInSequence_PooledStreamReused() { - await InitializeConnectionAsync(_echoApplication); + TaskCompletionSource appDelegateTcs = null; + + await InitializeConnectionAsync(async context => + { + await appDelegateTcs.Task; + }); Assert.Equal(0, _connection.StreamPool.Count); + appDelegateTcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); await StartStreamAsync(1, _browserRequestHeaders, endStream: true); + appDelegateTcs.TrySetResult(null); + await ExpectAsync(Http2FrameType.HEADERS, withLength: 55, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), @@ -129,16 +137,19 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // Stream has been returned to the pool Assert.Equal(1, _connection.StreamPool.Count); + appDelegateTcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); await StartStreamAsync(3, _browserRequestHeaders, endStream: true); + // New stream has been taken from the pool + Assert.Equal(0, _connection.StreamPool.Count); + + appDelegateTcs.TrySetResult(null); + await ExpectAsync(Http2FrameType.HEADERS, withLength: 55, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 3); - // New stream has been taken from the pool - Assert.Equal(0, _connection.StreamPool.Count); - // Ping will trigger the stream to be returned to the pool so we can assert it await SendPingAsync(Http2PingFrameFlags.NONE); await ExpectAsync(Http2FrameType.PING, From 8338060145f9b415504b6b0792cc65c496935226 Mon Sep 17 00:00:00 2001 From: Artak <34246760+mkArtakMSFT@users.noreply.github.com> Date: Fri, 28 Feb 2020 13:19:02 -0800 Subject: [PATCH 19/50] Update precedence and Identity of templates for 5.0 (#19248) (#19377) Co-authored-by: Ryan Brandenburg --- .../BlazorWasm-CSharp/.template.config/template.json | 2 +- .../BlazorServerWeb-CSharp/.template.config/template.json | 6 +++--- .../content/EmptyWeb-CSharp/.template.config/template.json | 4 ++-- .../content/EmptyWeb-FSharp/.template.config/template.json | 4 ++-- .../GrpcService-CSharp/.template.config/template.json | 4 ++-- .../RazorClassLibrary-CSharp/.template.config/template.json | 4 ++-- .../RazorPagesWeb-CSharp/.template.config/template.json | 6 +++--- .../StarterWeb-CSharp/.template.config/template.json | 6 +++--- .../StarterWeb-FSharp/.template.config/template.json | 6 +++--- .../content/WebApi-CSharp/.template.config/template.json | 4 ++-- .../content/WebApi-FSharp/.template.config/template.json | 4 ++-- .../content/Worker-CSharp/.template.config/template.json | 4 ++-- .../content/Angular-CSharp/.template.config/template.json | 4 ++-- .../content/React-CSharp/.template.config/template.json | 4 ++-- .../ReactRedux-CSharp/.template.config/template.json | 4 ++-- 15 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/.template.config/template.json b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/.template.config/template.json index 3297878253..e49f995289 100644 --- a/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/BlazorWasm.ProjectTemplates/content/BlazorWasm-CSharp/.template.config/template.json @@ -10,7 +10,7 @@ "defaultName": "WebApplication", "description": "A project template for creating a Blazor app that runs on WebAssembly and is optionally hosted by an ASP.NET Core app. This template can be used for web apps with rich dynamic user interfaces (UIs).", "groupIdentity": "Microsoft.Web.Blazor.Wasm", - "precedence": "6001", + "precedence": "7001", "guids": [ "4C26868E-5E7C-458D-82E3-040509D0C71F", "5990939C-7E7B-4CFA-86FF-44CA5756498A", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/template.json index 8a669b652a..66bfdc777b 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/.template.config/template.json @@ -9,10 +9,10 @@ "generatorVersions": "[1.0.0.0-*)", "description": "A project template for creating a Blazor server app that runs server-side inside an ASP.NET Core app and handles user interactions over a SignalR connection. This template can be used for web apps with rich dynamic user interfaces (UIs).", "groupIdentity": "Microsoft.Web.Blazor.Server", - "precedence": "6000", - "identity": "Microsoft.Web.Blazor.Server.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Web.Blazor.Server.CSharp.5.0", "shortName": "blazorserver", - "thirdPartyNotices": "https://aka.ms/aspnetcore/3.1-third-party-notices", + "thirdPartyNotices": "https://aka.ms/aspnetcore/5.0-third-party-notices", "tags": { "language": "C#", "type": "project" diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/.template.config/template.json index 08c6bb56c8..caf1ab80e6 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/.template.config/template.json @@ -9,8 +9,8 @@ "generatorVersions": "[1.0.0.0-*)", "description": "An empty project template for creating an ASP.NET Core application. This template does not have any content in it.", "groupIdentity": "Microsoft.Web.Empty", - "precedence": "6000", - "identity": "Microsoft.Web.Empty.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Web.Empty.CSharp.5.0", "shortName": "web", "tags": { "language": "C#", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-FSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-FSharp/.template.config/template.json index 7c9eb6c777..df7b62a169 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-FSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-FSharp/.template.config/template.json @@ -8,8 +8,8 @@ "generatorVersions": "[1.0.0.0-*)", "description": "An empty project template for creating an ASP.NET Core application. This template does not have any content in it.", "groupIdentity": "Microsoft.Web.Empty", - "precedence": "6000", - "identity": "Microsoft.Web.Empty.FSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Web.Empty.FSharp.5.0", "shortName": "web", "tags": { "language": "F#", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/.template.config/template.json index 0b8a573d28..0ca933164a 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/.template.config/template.json @@ -9,8 +9,8 @@ "generatorVersions": "[1.0.0.0-*)", "description": "A project template for creating a gRPC ASP.NET Core service.", "groupIdentity": "Microsoft.Web.Grpc", - "precedence": "6000", - "identity": "Microsoft.Grpc.Service.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Grpc.Service.CSharp.5.0", "shortName": "grpc", "tags": { "language": "C#", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/template.json index 86a7607fa2..543e0bdd5d 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/.template.config/template.json @@ -10,8 +10,8 @@ "generatorVersions": "[1.0.0.0-*)", "description": "A project for creating a Razor class library that targets .NET Standard", "groupIdentity": "Microsoft.Web.Razor", - "precedence": "6000", - "identity": "Microsoft.Web.Razor.Library.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Web.Razor.Library.CSharp.5.0", "shortName": "razorclasslib", "tags": { "language": "C#", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/template.json index 2d20ad2d45..81aacfa7e7 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/template.json @@ -10,13 +10,13 @@ "generatorVersions": "[1.0.0.0-*)", "description": "A project template for creating an ASP.NET Core application with example ASP.NET Core Razor Pages content", "groupIdentity": "Microsoft.Web.RazorPages", - "precedence": "6000", - "identity": "Microsoft.Web.RazorPages.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Web.RazorPages.CSharp.5.0", "shortName": [ "webapp", "razor" ], - "thirdPartyNotices": "https://aka.ms/aspnetcore/3.1-third-party-notices", + "thirdPartyNotices": "https://aka.ms/aspnetcore/5.0-third-party-notices", "tags": { "language": "C#", "type": "project" diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/template.json index b690f80eff..d846394fa9 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/.template.config/template.json @@ -9,10 +9,10 @@ "generatorVersions": "[1.0.0.0-*)", "description": "A project template for creating an ASP.NET Core application with example ASP.NET Core MVC Views and Controllers. This template can also be used for RESTful HTTP services.", "groupIdentity": "Microsoft.Web.Mvc", - "precedence": "6000", - "identity": "Microsoft.Web.Mvc.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Web.Mvc.CSharp.5.0", "shortName": "mvc", - "thirdPartyNotices": "https://aka.ms/aspnetcore/3.1-third-party-notices", + "thirdPartyNotices": "https://aka.ms/aspnetcore/5.0-third-party-notices", "tags": { "language": "C#", "type": "project" diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/.template.config/template.json index 487cdfc527..779cf7d82c 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/.template.config/template.json @@ -9,10 +9,10 @@ "generatorVersions": "[1.0.0.0-*)", "description": "A project template for creating an ASP.NET Core application with example ASP.NET Core MVC Views and Controllers. This template can also be used for RESTful HTTP services.", "groupIdentity": "Microsoft.Web.Mvc", - "precedence": "6000", - "identity": "Microsoft.Web.Mvc.FSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Web.Mvc.FSharp.5.0", "shortName": "mvc", - "thirdPartyNotices": "https://aka.ms/aspnetcore/3.1-third-party-notices", + "thirdPartyNotices": "https://aka.ms/aspnetcore/5.0-third-party-notices", "tags": { "language": "F#", "type": "project" diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/template.json index 2de35fc292..9c560017be 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/template.json @@ -9,8 +9,8 @@ "generatorVersions": "[1.0.0.0-*)", "description": "A project template for creating an ASP.NET Core application with an example Controller for a RESTful HTTP service. This template can also be used for ASP.NET Core MVC Views and Controllers.", "groupIdentity": "Microsoft.Web.WebApi", - "precedence": "6000", - "identity": "Microsoft.Web.WebApi.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Web.WebApi.CSharp.5.0", "shortName": "webapi", "tags": { "language": "C#", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/template.json index e1639b58b9..b3f4e81300 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/.template.config/template.json @@ -8,8 +8,8 @@ "generatorVersions": "[1.0.0.0-*)", "description": "A project template for creating an ASP.NET Core application with an example Controller for a RESTful HTTP service. This template can also be used for ASP.NET Core MVC Views and Controllers.", "groupIdentity": "Microsoft.Web.WebApi", - "precedence": "6000", - "identity": "Microsoft.Web.WebApi.FSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Web.WebApi.FSharp.5.0", "shortName": "webapi", "tags": { "language": "F#", diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp/.template.config/template.json index 16156aef0d..fa3775c564 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp/.template.config/template.json @@ -10,8 +10,8 @@ "generatorVersions": "[1.0.0.0-*)", "description": "An empty project template for creating a worker service.", "groupIdentity": "Microsoft.Worker.Empty", - "precedence": "6000", - "identity": "Microsoft.Worker.Empty.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.Worker.Empty.CSharp.5.0", "shortName": "worker", "tags": { "language": "C#", diff --git a/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/Angular-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/Angular-CSharp/.template.config/template.json index f0162aa616..fb376267c2 100644 --- a/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/Angular-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/Angular-CSharp/.template.config/template.json @@ -6,8 +6,8 @@ "SPA" ], "groupIdentity": "Microsoft.DotNet.Web.Spa.ProjectTemplates.Angular", - "precedence": "6000", - "identity": "Microsoft.DotNet.Web.Spa.ProjectTemplates.Angular.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.DotNet.Web.Spa.ProjectTemplates.Angular.CSharp.5.0", "name": "ASP.NET Core with Angular", "preferNameDirectory": true, "primaryOutputs": [ diff --git a/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/React-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/React-CSharp/.template.config/template.json index 6490d8e061..4b2e6ad786 100644 --- a/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/React-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/React-CSharp/.template.config/template.json @@ -6,8 +6,8 @@ "SPA" ], "groupIdentity": "Microsoft.DotNet.Web.Spa.ProjectTemplates.React", - "precedence": "6000", - "identity": "Microsoft.DotNet.Web.Spa.ProjectTemplates.React.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.DotNet.Web.Spa.ProjectTemplates.React.CSharp.5.0", "name": "ASP.NET Core with React.js", "preferNameDirectory": true, "primaryOutputs": [ diff --git a/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/.template.config/template.json b/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/.template.config/template.json index 0f2945d10f..f32b4adac4 100644 --- a/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/.template.config/template.json +++ b/src/ProjectTemplates/Web.Spa.ProjectTemplates/content/ReactRedux-CSharp/.template.config/template.json @@ -6,8 +6,8 @@ "SPA" ], "groupIdentity": "Microsoft.DotNet.Web.Spa.ProjectTemplates.ReactRedux", - "precedence": "6000", - "identity": "Microsoft.DotNet.Web.Spa.ProjectTemplates.ReactRedux.CSharp.3.1", + "precedence": "7000", + "identity": "Microsoft.DotNet.Web.Spa.ProjectTemplates.ReactRedux.CSharp.5.0", "name": "ASP.NET Core with React.js and Redux", "preferNameDirectory": true, "primaryOutputs": [ From 503a7f0acadf4f3b32f9c538c74b9cfef47cde16 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 28 Feb 2020 22:28:05 +0000 Subject: [PATCH 20/50] [master] Update dependencies from dotnet/aspnetcore-tooling (#19433) * Update dependencies from https://github.com/dotnet/aspnetcore-tooling build 20200227.8 - Microsoft.AspNetCore.Mvc.Razor.Extensions - 5.0.0-preview.2.20127.8 - Microsoft.AspNetCore.Razor.Language - 5.0.0-preview.2.20127.8 - Microsoft.CodeAnalysis.Razor - 5.0.0-preview.2.20127.8 - Microsoft.NET.Sdk.Razor - 5.0.0-preview.2.20127.8 Dependency coherency updates - Microsoft.AspNetCore.Analyzer.Testing - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Caching.Abstractions - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Caching.Memory - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Caching.SqlServer - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Caching.StackExchangeRedis - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.Abstractions - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.AzureKeyVault - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.Binder - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.CommandLine - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.EnvironmentVariables - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.FileExtensions - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.Ini - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.Json - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.UserSecrets - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.Xml - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.DependencyInjection.Abstractions - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.DependencyInjection - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.DiagnosticAdapter - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.FileProviders.Abstractions - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.FileProviders.Composite - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.FileProviders.Physical - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.FileSystemGlobbing - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Hosting.Abstractions - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Hosting - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Http - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.Abstractions - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.AzureAppServices - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.Configuration - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.Console - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.Debug - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.EventSource - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.EventLog - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.TraceSource - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.Testing - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Options.ConfigurationExtensions - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Options.DataAnnotations - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Options - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Primitives - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Internal.Extensions.Refs - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Internal.AspNetCore.Analyzers - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.AspNetCore.Testing - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Net.Compilers.Toolset - 3.5.0-beta4-20128-01 (parent: Microsoft.Extensions.Logging) * Update dependencies from https://github.com/dotnet/aspnetcore-tooling build 20200228.2 - Microsoft.AspNetCore.Mvc.Razor.Extensions - 5.0.0-preview.2.20128.2 - Microsoft.AspNetCore.Razor.Language - 5.0.0-preview.2.20128.2 - Microsoft.CodeAnalysis.Razor - 5.0.0-preview.2.20128.2 - Microsoft.NET.Sdk.Razor - 5.0.0-preview.2.20128.2 Dependency coherency updates - Microsoft.AspNetCore.Analyzer.Testing - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Caching.Abstractions - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Caching.Memory - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Caching.SqlServer - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Caching.StackExchangeRedis - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.Abstractions - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.AzureKeyVault - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.Binder - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.CommandLine - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.EnvironmentVariables - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.FileExtensions - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.Ini - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.Json - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.UserSecrets - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.Xml - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.DependencyInjection.Abstractions - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.DependencyInjection - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.DiagnosticAdapter - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.FileProviders.Abstractions - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.FileProviders.Composite - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.FileProviders.Physical - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.FileSystemGlobbing - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Hosting.Abstractions - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Hosting - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Http - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.Abstractions - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.AzureAppServices - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.Configuration - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.Console - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.Debug - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.EventSource - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.EventLog - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.TraceSource - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.Testing - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Options.ConfigurationExtensions - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Options.DataAnnotations - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Options - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Primitives - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Internal.Extensions.Refs - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Internal.AspNetCore.Analyzers - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.AspNetCore.Testing - 5.0.0-preview.2.20127.2 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Net.Compilers.Toolset - 3.5.0-beta4-20128-01 (parent: Microsoft.Extensions.Logging) --- eng/Version.Details.xml | 192 ++++++++++++++++++++-------------------- eng/Versions.props | 96 ++++++++++---------- 2 files changed, 144 insertions(+), 144 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b38bbf83cf..67dabb07af 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -13,21 +13,21 @@ https://github.com/dotnet/blazor dd7fb4d3931d556458f62642c2edfc59f6295bfb - + https://github.com/dotnet/aspnetcore-tooling - 01654d8439f104a37bd8992ad3d31c596821806f + 054702fcf0b59ac93e219d72a9b0071ee7d4b98c - + https://github.com/dotnet/aspnetcore-tooling - 01654d8439f104a37bd8992ad3d31c596821806f + 054702fcf0b59ac93e219d72a9b0071ee7d4b98c - + https://github.com/dotnet/aspnetcore-tooling - 01654d8439f104a37bd8992ad3d31c596821806f + 054702fcf0b59ac93e219d72a9b0071ee7d4b98c - + https://github.com/dotnet/aspnetcore-tooling - 01654d8439f104a37bd8992ad3d31c596821806f + 054702fcf0b59ac93e219d72a9b0071ee7d4b98c https://github.com/dotnet/efcore @@ -57,169 +57,169 @@ https://github.com/dotnet/efcore ca43ad17d612518231cc6b8a359e7168de1f76f1 - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc https://github.com/dotnet/runtime @@ -332,9 +332,9 @@ https://github.com/dotnet/runtime 4807684b13d473c19121fbe757296e7607f3cabf - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc https://github.com/dotnet/arcade @@ -348,13 +348,13 @@ https://github.com/dotnet/arcade cd4164e1f3f7daf2a6f8dbd012210c93521bd82f - + https://github.com/dotnet/extensions - 8fb38ab52b8f873109b6e87b4f04226d6a892ee4 + 7dd11a1cc48239176f50af69e94dc483263e51bc - + https://github.com/dotnet/roslyn - 1baa0b3063238ed752ad1f0368b1df6b6901373e + c59debd7a94d135fd96728b7992a5bf841fe9a99 diff --git a/eng/Versions.props b/eng/Versions.props index 7b47b96873..19e1a7746f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -64,7 +64,7 @@ 5.0.0-beta.20126.7 - 3.5.0-beta4-20125-04 + 3.5.0-beta4-20128-01 5.0.0-preview.2.20125.16 5.0.0-preview.2.20125.16 @@ -97,49 +97,49 @@ 3.2.0-preview1.20067.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20127.2 5.0.0-preview.2.20126.1 5.0.0-preview.2.20126.1 @@ -149,10 +149,10 @@ 5.0.0-preview.2.20126.1 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20127.6 - 5.0.0-preview.2.20127.6 - 5.0.0-preview.2.20127.6 - 5.0.0-preview.2.20127.6 + 5.0.0-preview.2.20128.2 + 5.0.0-preview.2.20128.2 + 5.0.0-preview.2.20128.2 + 5.0.0-preview.2.20128.2 - 5.0.0-preview.2.20128.2 - 5.0.0-preview.2.20128.2 - 5.0.0-preview.2.20128.2 - 5.0.0-preview.2.20128.2 + 5.0.0-preview.2.20128.4 + 5.0.0-preview.2.20128.4 + 5.0.0-preview.2.20128.4 + 5.0.0-preview.2.20128.4 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 - 5.0.0-preview.2.20126.1 + 5.0.0-preview.2.20128.3 + 5.0.0-preview.2.20128.3 + 5.0.0-preview.2.20128.3 + 5.0.0-preview.2.20128.3 + 5.0.0-preview.2.20128.3 + 5.0.0-preview.2.20128.3 + 5.0.0-preview.2.20128.3 5.0.0-preview.2.20128.4 5.0.0-preview.2.20128.4 From 3b715e1aebf7a7ec7f5c183460f156ea4b92a5ec Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 29 Feb 2020 01:30:08 +0000 Subject: [PATCH 23/50] Update dependencies from https://github.com/dotnet/aspnetcore-tooling build 20200228.5 (#19458) - Microsoft.AspNetCore.Mvc.Razor.Extensions - 5.0.0-preview.2.20128.5 - Microsoft.AspNetCore.Razor.Language - 5.0.0-preview.2.20128.5 - Microsoft.CodeAnalysis.Razor - 5.0.0-preview.2.20128.5 - Microsoft.NET.Sdk.Razor - 5.0.0-preview.2.20128.5 Dependency coherency updates - Microsoft.AspNetCore.Analyzer.Testing - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Caching.Abstractions - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Caching.Memory - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Caching.SqlServer - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Caching.StackExchangeRedis - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.Abstractions - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.AzureKeyVault - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.Binder - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.CommandLine - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.EnvironmentVariables - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.FileExtensions - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.Ini - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.Json - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.UserSecrets - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.Xml - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.DependencyInjection.Abstractions - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.DependencyInjection - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.DiagnosticAdapter - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.FileProviders.Abstractions - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.FileProviders.Composite - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.FileProviders.Physical - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.FileSystemGlobbing - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Hosting.Abstractions - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Hosting - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Http - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.Abstractions - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.AzureAppServices - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.Configuration - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.Console - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.Debug - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.EventSource - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.EventLog - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.TraceSource - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.Testing - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Options.ConfigurationExtensions - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Options.DataAnnotations - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Options - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Primitives - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Internal.Extensions.Refs - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Win32.Registry - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 5.0.0-preview.2.20127.14 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Win32.SystemEvents - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.ComponentModel.Annotations - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Diagnostics.EventLog - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Drawing.Common - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.IO.Pipelines - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Net.Http.WinHttpHandler - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Net.WebSockets.WebSocketProtocol - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Reflection.Metadata - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Runtime.CompilerServices.Unsafe - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Security.Cryptography.Cng - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Security.Cryptography.Pkcs - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Security.Cryptography.Xml - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Security.Permissions - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Security.Principal.Windows - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.ServiceProcess.ServiceController - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Text.Encodings.Web - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Text.Json - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Threading.Channels - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Windows.Extensions - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.Extensions.DependencyModel - 5.0.0-preview.2.20127.14 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Ref - 5.0.0-preview.2.20127.14 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Internal - 5.0.0-preview.2.20127.14 (parent: Microsoft.Extensions.Logging) - NETStandard.Library.Ref - 2.1.0-preview.2.20127.14 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.Platforms - 5.0.0-preview.2.20127.14 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Internal.AspNetCore.Analyzers - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.AspNetCore.Testing - 5.0.0-preview.2.20128.1 (parent: Microsoft.AspNetCore.Razor.Language) --- eng/Version.Details.xml | 292 ++++++++++++++++++++-------------------- eng/Versions.props | 146 ++++++++++---------- 2 files changed, 219 insertions(+), 219 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 107cba2374..fefe871521 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -13,21 +13,21 @@ https://github.com/dotnet/blazor dd7fb4d3931d556458f62642c2edfc59f6295bfb - + https://github.com/dotnet/aspnetcore-tooling - 054702fcf0b59ac93e219d72a9b0071ee7d4b98c + 965ce755d56a15cae3f281a8d1bfcfee01a6d140 - + https://github.com/dotnet/aspnetcore-tooling - 054702fcf0b59ac93e219d72a9b0071ee7d4b98c + 965ce755d56a15cae3f281a8d1bfcfee01a6d140 - + https://github.com/dotnet/aspnetcore-tooling - 054702fcf0b59ac93e219d72a9b0071ee7d4b98c + 965ce755d56a15cae3f281a8d1bfcfee01a6d140 - + https://github.com/dotnet/aspnetcore-tooling - 054702fcf0b59ac93e219d72a9b0071ee7d4b98c + 965ce755d56a15cae3f281a8d1bfcfee01a6d140 https://github.com/dotnet/efcore @@ -57,284 +57,284 @@ https://github.com/dotnet/efcore 6fa6b9f96401cb9b81dcf5e90f1d8e7d39728bf4 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/runtime - 4807684b13d473c19121fbe757296e7607f3cabf + 487c940876b1932920454c44d2463d996cc8407c - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 https://github.com/dotnet/arcade @@ -348,9 +348,9 @@ https://github.com/dotnet/arcade cd4164e1f3f7daf2a6f8dbd012210c93521bd82f - + https://github.com/dotnet/extensions - 7dd11a1cc48239176f50af69e94dc483263e51bc + 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 https://github.com/dotnet/roslyn diff --git a/eng/Versions.props b/eng/Versions.props index eefe44242f..760908d9e3 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -66,80 +66,80 @@ 3.5.0-beta4-20128-01 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 2.1.0-preview.2.20125.16 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 2.1.0-preview.2.20127.14 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 - 5.0.0-preview.2.20125.16 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20125.16 + 5.0.0-preview.2.20127.14 3.2.0-preview1.20067.1 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 - 5.0.0-preview.2.20127.2 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20128.1 5.0.0-preview.2.20128.3 5.0.0-preview.2.20128.3 @@ -149,10 +149,10 @@ 5.0.0-preview.2.20128.3 5.0.0-preview.2.20128.3 - 5.0.0-preview.2.20128.4 - 5.0.0-preview.2.20128.4 - 5.0.0-preview.2.20128.4 - 5.0.0-preview.2.20128.4 + 5.0.0-preview.2.20128.5 + 5.0.0-preview.2.20128.5 + 5.0.0-preview.2.20128.5 + 5.0.0-preview.2.20128.5 - 5.0.0-preview.2.20128.5 - 5.0.0-preview.2.20128.5 - 5.0.0-preview.2.20128.5 - 5.0.0-preview.2.20128.5 + 5.0.0-preview.2.20128.7 + 5.0.0-preview.2.20128.7 + 5.0.0-preview.2.20128.7 + 5.0.0-preview.2.20128.7 - 5.0.0-preview.2.20128.7 - 5.0.0-preview.2.20128.7 - 5.0.0-preview.2.20128.7 - 5.0.0-preview.2.20128.7 + 5.0.0-preview.2.20128.9 + 5.0.0-preview.2.20128.9 + 5.0.0-preview.2.20128.9 + 5.0.0-preview.2.20128.9 - 5.0.0-beta.20126.7 + 5.0.0-beta.20151.1 3.5.0-beta4-20128-01 diff --git a/eng/common/dotnet-install.sh b/eng/common/dotnet-install.sh index 50bc5e475c..ead6a1d9a2 100755 --- a/eng/common/dotnet-install.sh +++ b/eng/common/dotnet-install.sh @@ -63,7 +63,7 @@ case $cpuname in amd64|x86_64) buildarch=x64 ;; - armv7l) + armv*l) buildarch=arm ;; i686) diff --git a/eng/common/init-tools-native.sh b/eng/common/init-tools-native.sh index dbd7cbfdf6..29fc5db8ae 100755 --- a/eng/common/init-tools-native.sh +++ b/eng/common/init-tools-native.sh @@ -34,6 +34,14 @@ while (($# > 0)); do force=true shift 1 ;; + --donotabortonfailure) + donotabortonfailure=true + shift 1 + ;; + --donotdisplaywarnings) + donotdisplaywarnings=true + shift 1 + ;; --downloadretries) download_retries=$2 shift 2 @@ -52,6 +60,8 @@ while (($# > 0)); do echo " - (default) %USERPROFILE%/.netcoreeng/native" echo "" echo " --clean Switch specifying not to install anything, but cleanup native asset folders" + echo " --donotabortonfailure Switch specifiying whether to abort native tools installation on failure" + echo " --donotdisplaywarnings Switch specifiying whether to display warnings during native tools installation on failure" echo " --force Clean and then install tools" echo " --help Print help and exit" echo "" @@ -92,6 +102,7 @@ if [[ -z $install_directory ]]; then fi install_bin="${native_base_dir}/bin" +installed_any=false ReadGlobalJsonNativeTools @@ -103,8 +114,8 @@ else for tool in "${!native_assets[@]}" do tool_version=${native_assets[$tool]} - installer_name="install-$tool.sh" - installer_command="$native_installer_dir/$installer_name" + installer_path="$native_installer_dir/install-$tool.sh" + installer_command="$installer_path" installer_command+=" --baseuri $base_uri" installer_command+=" --installpath $install_bin" installer_command+=" --version $tool_version" @@ -118,11 +129,29 @@ else installer_command+=" --clean" fi - $installer_command - - if [[ $? != 0 ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed" - exit 1 + if [[ -a $installer_path ]]; then + $installer_command + if [[ $? != 0 ]]; then + if [[ $donotabortonfailure = true ]]; then + if [[ $donotdisplaywarnings != true ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed" + fi + else + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed" + exit 1 + fi + else + $installed_any = true + fi + else + if [[ $donotabortonfailure == true ]]; then + if [[ $donotdisplaywarnings != true ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed: no install script" + fi + else + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed: no install script" + exit 1 + fi fi done fi @@ -135,8 +164,10 @@ if [[ -d $install_bin ]]; then echo "Native tools are available from $install_bin" echo "##vso[task.prependpath]$install_bin" else - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Native tools install directory does not exist, installation failed" - exit 1 + if [[ $installed_any = true ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Native tools install directory does not exist, installation failed" + exit 1 + fi fi exit 0 diff --git a/eng/common/performance/perfhelixpublish.proj b/eng/common/performance/perfhelixpublish.proj index e5826b5323..cf5941e1b6 100644 --- a/eng/common/performance/perfhelixpublish.proj +++ b/eng/common/performance/perfhelixpublish.proj @@ -6,7 +6,7 @@ py -3 %HELIX_CORRELATION_PAYLOAD%\Core_Root\CoreRun.exe %HELIX_CORRELATION_PAYLOAD%\Baseline_Core_Root\CoreRun.exe - $(HelixPreCommands);call %HELIX_CORRELATION_PAYLOAD%\performance\tools\machine-setup.cmd + $(HelixPreCommands);call %HELIX_CORRELATION_PAYLOAD%\performance\tools\machine-setup.cmd;set PYTHONPATH=%HELIX_WORKITEM_PAYLOAD%\scripts%3B%HELIX_WORKITEM_PAYLOAD% %HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts %HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts_Baseline %HELIX_CORRELATION_PAYLOAD%\performance\src\tools\ResultsComparer\ResultsComparer.csproj @@ -99,4 +99,23 @@ 4:00 + + + + $(WorkItemDirectory)\ScenarioCorrelation + $(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name System.Private.Xml.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root + + + $(WorkItemDirectory)\ScenarioCorrelation + $(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name System.Linq.Expressions.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root + + + $(WorkItemDirectory)\ScenarioCorrelation + $(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name Microsoft.CodeAnalysis.VisualBasic.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root + + + $(WorkItemDirectory)\ScenarioCorrelation + $(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name Microsoft.CodeAnalysis.CSharp.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root + + \ No newline at end of file diff --git a/global.json b/global.json index 690fcfbd34..15a1a6543e 100644 --- a/global.json +++ b/global.json @@ -25,7 +25,7 @@ }, "msbuild-sdks": { "Yarn.MSBuild": "1.15.2", - "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20126.7", - "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20126.7" + "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20151.1", + "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20151.1" } } From d08ecf003ac2484351222be94cc0acb5d451a2c2 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 16:07:21 +0000 Subject: [PATCH 28/50] Update dependencies from https://github.com/dotnet/efcore build 20200302.1 (#19499) - Microsoft.EntityFrameworkCore.Tools - 5.0.0-preview.2.20152.1 - Microsoft.EntityFrameworkCore.SqlServer - 5.0.0-preview.2.20152.1 - dotnet-ef - 5.0.0-preview.2.20152.1 - Microsoft.EntityFrameworkCore - 5.0.0-preview.2.20152.1 - Microsoft.EntityFrameworkCore.InMemory - 5.0.0-preview.2.20152.1 - Microsoft.EntityFrameworkCore.Relational - 5.0.0-preview.2.20152.1 - Microsoft.EntityFrameworkCore.Sqlite - 5.0.0-preview.2.20152.1 --- eng/Version.Details.xml | 28 ++++++++++++++-------------- eng/Versions.props | 14 +++++++------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index f3056a0877..896c0e4c61 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -29,33 +29,33 @@ https://github.com/dotnet/aspnetcore-tooling 216201b64a9d139defd5a884779ae53da8844f17 - + https://github.com/dotnet/efcore - 6fa6b9f96401cb9b81dcf5e90f1d8e7d39728bf4 + c65bdd5f71b32a341fb4734e131fa3d9dd30128a - + https://github.com/dotnet/efcore - 6fa6b9f96401cb9b81dcf5e90f1d8e7d39728bf4 + c65bdd5f71b32a341fb4734e131fa3d9dd30128a - + https://github.com/dotnet/efcore - 6fa6b9f96401cb9b81dcf5e90f1d8e7d39728bf4 + c65bdd5f71b32a341fb4734e131fa3d9dd30128a - + https://github.com/dotnet/efcore - 6fa6b9f96401cb9b81dcf5e90f1d8e7d39728bf4 + c65bdd5f71b32a341fb4734e131fa3d9dd30128a - + https://github.com/dotnet/efcore - 6fa6b9f96401cb9b81dcf5e90f1d8e7d39728bf4 + c65bdd5f71b32a341fb4734e131fa3d9dd30128a - + https://github.com/dotnet/efcore - 6fa6b9f96401cb9b81dcf5e90f1d8e7d39728bf4 + c65bdd5f71b32a341fb4734e131fa3d9dd30128a - + https://github.com/dotnet/efcore - 6fa6b9f96401cb9b81dcf5e90f1d8e7d39728bf4 + c65bdd5f71b32a341fb4734e131fa3d9dd30128a https://github.com/dotnet/extensions diff --git a/eng/Versions.props b/eng/Versions.props index cf7f61c554..553da38bb1 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -141,13 +141,13 @@ 5.0.0-preview.2.20128.1 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.3 - 5.0.0-preview.2.20128.3 - 5.0.0-preview.2.20128.3 - 5.0.0-preview.2.20128.3 - 5.0.0-preview.2.20128.3 - 5.0.0-preview.2.20128.3 - 5.0.0-preview.2.20128.3 + 5.0.0-preview.2.20152.1 + 5.0.0-preview.2.20152.1 + 5.0.0-preview.2.20152.1 + 5.0.0-preview.2.20152.1 + 5.0.0-preview.2.20152.1 + 5.0.0-preview.2.20152.1 + 5.0.0-preview.2.20152.1 5.0.0-preview.2.20128.9 5.0.0-preview.2.20128.9 From 5e2a7726c63b7d6e4b6aca09bfac756679b0c000 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 2 Mar 2020 11:43:34 -0800 Subject: [PATCH 29/50] [Helix] Reenable some Templates tests 2.0 (#19383) --- eng/helix/content/runtests.cmd | 11 ++++++ eng/helix/content/runtests.sh | 14 ++++++++ eng/targets/Helix.targets | 4 +-- src/ProjectTemplates/test/Helpers/Project.cs | 36 ++++++++++++++----- .../test/IdentityUIPackageTest.cs | 4 +-- src/ProjectTemplates/test/MvcTemplateTest.cs | 6 ++-- .../test/RazorClassLibraryTemplateTest.cs | 4 +-- .../test/RazorPagesTemplateTest.cs | 6 ++-- .../test/WorkerTemplateTest.cs | 3 +- 9 files changed, 62 insertions(+), 26 deletions(-) diff --git a/eng/helix/content/runtests.cmd b/eng/helix/content/runtests.cmd index 73cf658c18..4917f46c0e 100644 --- a/eng/helix/content/runtests.cmd +++ b/eng/helix/content/runtests.cmd @@ -9,6 +9,7 @@ set $runtimeVersion=%3 set $helixQueue=%4 set $arch=%5 set $quarantined=%6 +set $efVersion=%7 set DOTNET_HOME=%HELIX_CORRELATION_PAYLOAD%\sdk set DOTNET_ROOT=%DOTNET_HOME%\%$arch% @@ -24,6 +25,14 @@ powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePo if EXIST ".\Microsoft.AspNetCore.App" ( echo "Found Microsoft.AspNetCore.App, copying to %DOTNET_ROOT%\shared\Microsoft.AspNetCore.App\%runtimeVersion%" xcopy /i /y ".\Microsoft.AspNetCore.App" %DOTNET_ROOT%\shared\Microsoft.AspNetCore.App\%runtimeVersion%\ + + echo "Adding current directory to nuget sources: %HELIX_WORKITEM_ROOT%" + dotnet nuget add source %HELIX_WORKITEM_ROOT% + dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json + dotnet nuget list source + dotnet tool install dotnet-ef --global --version %$efVersion% + + set PATH=%PATH%;%DOTNET_CLI_HOME%\.dotnet\tools ) echo "Current Directory: %HELIX_WORKITEM_ROOT%" @@ -31,6 +40,8 @@ set HELIX=%$helixQueue% set HELIX_DIR=%HELIX_WORKITEM_ROOT% set NUGET_FALLBACK_PACKAGES=%HELIX_DIR% set NUGET_RESTORE=%HELIX_DIR%\nugetRestore +set DotNetEfFullPath=%HELIX_DIR%\nugetRestore\dotnet-ef\%$efVersion%\tools\netcoreapp3.1\any\dotnet-ef.exe +echo "Set DotNetEfFullPath: %DotNetEfFullPath%" echo "Setting HELIX_DIR: %HELIX_DIR%" echo Creating nuget restore directory: %NUGET_RESTORE% mkdir %NUGET_RESTORE% diff --git a/eng/helix/content/runtests.sh b/eng/helix/content/runtests.sh index c31297d587..a82a5aa0f4 100644 --- a/eng/helix/content/runtests.sh +++ b/eng/helix/content/runtests.sh @@ -6,6 +6,7 @@ dotnet_runtime_version="$3" helix_queue_name="$4" target_arch="$5" quarantined="$6" +efVersion="$7" RESET="\033[0m" RED="\033[0;31m" @@ -33,6 +34,8 @@ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 export helix="$helix_queue_name" export HELIX_DIR="$DIR" export NUGET_FALLBACK_PACKAGES="$DIR" +export DotNetEfFullPath=$DIR\nugetRestore\dotnet-ef\$efVersion\tools\netcoreapp3.1\any\dotnet-ef.dll +echo "Set DotNetEfFullPath: $DotNetEfFullPath" export NUGET_RESTORE="$DIR/nugetRestore" echo "Creating nugetRestore directory: $NUGET_RESTORE" mkdir $NUGET_RESTORE @@ -95,6 +98,17 @@ if [ -d "Microsoft.AspNetCore.App" ] then echo "Found Microsoft.AspNetCore.App directory, copying to $DOTNET_ROOT/shared/Microsoft.AspNetCore.App/$dotnet_runtime_version." cp -r Microsoft.AspNetCore.App $DOTNET_ROOT/shared/Microsoft.AspNetCore.App/$dotnet_runtime_version + + echo "Adding current directory to nuget sources: $DIR" + dotnet nuget add source $DIR + dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json + dotnet nuget list source + + dotnet tool install dotnet-ef --global --version $efVersion + + # Ensure tools are on on PATH + export PATH="$PATH:$DOTNET_CLI_HOME/.dotnet/tools" + fi if [ -e /proc/self/coredump_filter ]; then diff --git a/eng/targets/Helix.targets b/eng/targets/Helix.targets index 0084984353..154ce92ee6 100644 --- a/eng/targets/Helix.targets +++ b/eng/targets/Helix.targets @@ -120,8 +120,8 @@ Usage: dotnet msbuild /t:Helix src/MyTestProject.csproj $(TargetFileName) @(HelixPreCommand) @(HelixPostCommand) - call runtests.cmd $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppRuntimeVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) - ./runtests.sh $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppRuntimeVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) + call runtests.cmd $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppRuntimeVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(DotnetEfPackageVersion) + ./runtests.sh $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppRuntimeVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(DotnetEfPackageVersion) $(HelixCommand) $(HelixTimeout) diff --git a/src/ProjectTemplates/test/Helpers/Project.cs b/src/ProjectTemplates/test/Helpers/Project.cs index 28a9bdd917..3fdcdf9d0c 100644 --- a/src/ProjectTemplates/test/Helpers/Project.cs +++ b/src/ProjectTemplates/test/Helpers/Project.cs @@ -7,6 +7,7 @@ using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; +using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.CommandLineUtils; @@ -28,12 +29,11 @@ namespace Templates.Test.Helpers ? GetAssemblyMetadata("ArtifactsLogDir") : Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "logs"); - // FIGURE OUT EF PATH - public static string DotNetEfFullPath => (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) + public static string DotNetEfFullPath => (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath"))) ? typeof(ProjectFactoryFixture).Assembly.GetCustomAttributes() .First(attribute => attribute.Key == "DotNetEfFullPath") .Value - : Path.Combine("NuGetPackageRoot", "dotnet-ef/$(DotnetEfPackageVersion)/tools/netcoreapp3.1/any/dotnet-ef.dll"); + : Environment.GetEnvironmentVariable("DotNetEfFullPath"); public SemaphoreSlim DotNetNewLock { get; set; } public SemaphoreSlim NodeLock { get; set; } @@ -306,14 +306,24 @@ namespace Templates.Test.Helpers internal async Task RunDotNetEfCreateMigrationAsync(string migrationName) { - var args = $"\"{DotNetEfFullPath}\" --verbose --no-build migrations add {migrationName}"; - + var args = $"--verbose --no-build migrations add {migrationName}"; + // Only run one instance of 'dotnet new' at once, as a workaround for // https://github.com/aspnet/templating/issues/63 await DotNetNewLock.WaitAsync(); try { - var result = ProcessEx.Run(Output, TemplateOutputDir, DotNetMuxer.MuxerPathOrDefault(), args); + var command = DotNetMuxer.MuxerPathOrDefault(); + if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath"))) + { + args = $"\"{DotNetEfFullPath}\" " + args; + } + else + { + command = "dotnet-ef"; + } + + var result = ProcessEx.Run(Output, TemplateOutputDir, command, args); await result.Exited; return result; } @@ -325,14 +335,24 @@ namespace Templates.Test.Helpers internal async Task RunDotNetEfUpdateDatabaseAsync() { - var args = $"\"{DotNetEfFullPath}\" --verbose --no-build database update"; + var args = "--verbose --no-build database update"; // Only run one instance of 'dotnet new' at once, as a workaround for // https://github.com/aspnet/templating/issues/63 await DotNetNewLock.WaitAsync(); try { - var result = ProcessEx.Run(Output, TemplateOutputDir, DotNetMuxer.MuxerPathOrDefault(), args); + var command = DotNetMuxer.MuxerPathOrDefault(); + if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath"))) + { + args = $"\"{DotNetEfFullPath}\" " + args; + } + else + { + command = "dotnet-ef"; + } + + var result = ProcessEx.Run(Output, TemplateOutputDir, command, args); await result.Exited; return result; } diff --git a/src/ProjectTemplates/test/IdentityUIPackageTest.cs b/src/ProjectTemplates/test/IdentityUIPackageTest.cs index fe794a3629..deede64521 100644 --- a/src/ProjectTemplates/test/IdentityUIPackageTest.cs +++ b/src/ProjectTemplates/test/IdentityUIPackageTest.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.IO; using System.Net; using System.Threading.Tasks; -using Microsoft.AspNetCore.Testing; using Templates.Test.Helpers; using Xunit; using Xunit.Abstractions; @@ -118,9 +117,8 @@ namespace Templates.Test "Identity/lib/jquery-validation-unobtrusive/LICENSE.txt", }; - [ConditionalTheory] + [Theory] [MemberData(nameof(MSBuildIdentityUIPackageOptions))] - [SkipOnHelix("ef restore no worky")] public async Task IdentityUIPackage_WorksWithDifferentOptions(IDictionary packageOptions, string versionValidator, string[] expectedFiles) { Project = await ProjectFactory.GetOrCreateProject("identityuipackage" + string.Concat(packageOptions.Values), Output); diff --git a/src/ProjectTemplates/test/MvcTemplateTest.cs b/src/ProjectTemplates/test/MvcTemplateTest.cs index 271aed575b..0dc0023bb9 100644 --- a/src/ProjectTemplates/test/MvcTemplateTest.cs +++ b/src/ProjectTemplates/test/MvcTemplateTest.cs @@ -104,10 +104,9 @@ namespace Templates.Test } } - [ConditionalTheory] + [Theory] [InlineData(true)] [InlineData(false)] - [SkipOnHelix("ef restore no worky")] public async Task MvcTemplate_IndividualAuth(bool useLocalDB) { Project = await ProjectFactory.GetOrCreateProject("mvcindividual" + (useLocalDB ? "uld" : ""), Output); @@ -222,8 +221,7 @@ namespace Templates.Test } } - [ConditionalFact] - [SkipOnHelix("razor compilation restore no worky")] + [Fact] public async Task MvcTemplate_RazorRuntimeCompilation_BuildsAndPublishes() { Project = await ProjectFactory.GetOrCreateProject("mvc_rc", Output); diff --git a/src/ProjectTemplates/test/RazorClassLibraryTemplateTest.cs b/src/ProjectTemplates/test/RazorClassLibraryTemplateTest.cs index f8d6bd65b5..0d02a56f8f 100644 --- a/src/ProjectTemplates/test/RazorClassLibraryTemplateTest.cs +++ b/src/ProjectTemplates/test/RazorClassLibraryTemplateTest.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using Templates.Test.Helpers; using Xunit; using Xunit.Abstractions; -using Microsoft.AspNetCore.Testing; namespace Templates.Test { @@ -41,8 +40,7 @@ namespace Templates.Test Assert.True(0 == buildResult.ExitCode, ErrorMessages.GetFailedProcessMessage("build", Project, buildResult)); } - [ConditionalFact] - [SkipOnHelix("restore no worky")] + [Fact] public async Task RazorClassLibraryTemplateAsync() { Project = await ProjectFactory.GetOrCreateProject("razorclasslib", Output); diff --git a/src/ProjectTemplates/test/RazorPagesTemplateTest.cs b/src/ProjectTemplates/test/RazorPagesTemplateTest.cs index 73e4a5da52..a0a57e48a9 100644 --- a/src/ProjectTemplates/test/RazorPagesTemplateTest.cs +++ b/src/ProjectTemplates/test/RazorPagesTemplateTest.cs @@ -94,10 +94,9 @@ namespace Templates.Test } } - [ConditionalTheory] + [Theory] [InlineData(false)] [InlineData(true)] - [SkipOnHelix("ef restore no worky")] public async Task RazorPagesTemplate_IndividualAuth(bool useLocalDB) { Project = await ProjectFactory.GetOrCreateProject("razorpagesindividual" + (useLocalDB ? "uld" : ""), Output); @@ -212,8 +211,7 @@ namespace Templates.Test } } - [ConditionalFact] - [SkipOnHelix("runtime compliation restore no worky")] + [Fact] public async Task RazorPagesTemplate_RazorRuntimeCompilation_BuildsAndPublishes() { Project = await ProjectFactory.GetOrCreateProject("razorpages_rc", Output); diff --git a/src/ProjectTemplates/test/WorkerTemplateTest.cs b/src/ProjectTemplates/test/WorkerTemplateTest.cs index 0299f17a11..0a3bca6568 100644 --- a/src/ProjectTemplates/test/WorkerTemplateTest.cs +++ b/src/ProjectTemplates/test/WorkerTemplateTest.cs @@ -21,8 +21,7 @@ namespace Templates.Test public ProjectFactoryFixture ProjectFactory { get; } public ITestOutputHelper Output { get; } - [ConditionalFact] - [SkipOnHelix("restore no worky")] + [Fact] public async Task WorkerTemplateAsync() { Project = await ProjectFactory.GetOrCreateProject("worker", Output); From 4902672a3e55a607617461b1460a9717bfa22ded Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 21:18:53 +0000 Subject: [PATCH 30/50] Update dependencies from https://github.com/dotnet/aspnetcore-tooling build 20200302.1 (#19500) - Microsoft.AspNetCore.Mvc.Razor.Extensions - 5.0.0-preview.2.20152.1 - Microsoft.AspNetCore.Razor.Language - 5.0.0-preview.2.20152.1 - Microsoft.CodeAnalysis.Razor - 5.0.0-preview.2.20152.1 - Microsoft.NET.Sdk.Razor - 5.0.0-preview.2.20152.1 Dependency coherency updates - Microsoft.AspNetCore.Analyzer.Testing - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Caching.Abstractions - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Caching.Memory - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Caching.SqlServer - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Caching.StackExchangeRedis - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.Abstractions - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.AzureKeyVault - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.Binder - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.CommandLine - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.EnvironmentVariables - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.FileExtensions - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.Ini - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.Json - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.UserSecrets - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration.Xml - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Configuration - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.DependencyInjection.Abstractions - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.DependencyInjection - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.DiagnosticAdapter - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.FileProviders.Abstractions - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.FileProviders.Composite - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.FileProviders.Physical - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.FileSystemGlobbing - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Hosting.Abstractions - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Hosting - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Http - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.Abstractions - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.AzureAppServices - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.Configuration - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.Console - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.Debug - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.EventSource - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.EventLog - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.TraceSource - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Logging.Testing - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Options.ConfigurationExtensions - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Options.DataAnnotations - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Options - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Extensions.Primitives - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Internal.Extensions.Refs - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Win32.Registry - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.NETCore.App.Runtime.win-x64 - 5.0.0-preview.2.20129.8 (parent: Microsoft.Extensions.Logging) - Microsoft.Extensions.Logging - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Win32.SystemEvents - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.ComponentModel.Annotations - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Diagnostics.EventLog - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Drawing.Common - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.IO.Pipelines - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Net.Http.WinHttpHandler - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Net.WebSockets.WebSocketProtocol - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Reflection.Metadata - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Runtime.CompilerServices.Unsafe - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Security.Cryptography.Cng - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Security.Cryptography.Pkcs - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Security.Cryptography.Xml - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Security.Permissions - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Security.Principal.Windows - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.ServiceProcess.ServiceController - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Text.Encodings.Web - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Text.Json - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Threading.Channels - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - System.Windows.Extensions - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.Extensions.DependencyModel - 5.0.0-preview.2.20129.8 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Ref - 5.0.0-preview.2.20129.8 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Internal - 5.0.0-preview.2.20129.8 (parent: Microsoft.Extensions.Logging) - NETStandard.Library.Ref - 2.1.0-preview.2.20129.8 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.Platforms - 5.0.0-preview.2.20129.8 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Internal.AspNetCore.Analyzers - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.AspNetCore.Testing - 5.0.0-preview.2.20151.1 (parent: Microsoft.AspNetCore.Razor.Language) - Microsoft.Net.Compilers.Toolset - 3.5.0-beta4-20128-03 (parent: Microsoft.Extensions.Logging) --- eng/Version.Details.xml | 296 ++++++++++++++++++++-------------------- eng/Versions.props | 148 ++++++++++---------- 2 files changed, 222 insertions(+), 222 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 896c0e4c61..4abcb8fb4d 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -13,21 +13,21 @@ https://github.com/dotnet/blazor dd7fb4d3931d556458f62642c2edfc59f6295bfb - + https://github.com/dotnet/aspnetcore-tooling - 216201b64a9d139defd5a884779ae53da8844f17 + df809abb8a1c7885496b799206999bb8f6e65091 - + https://github.com/dotnet/aspnetcore-tooling - 216201b64a9d139defd5a884779ae53da8844f17 + df809abb8a1c7885496b799206999bb8f6e65091 - + https://github.com/dotnet/aspnetcore-tooling - 216201b64a9d139defd5a884779ae53da8844f17 + df809abb8a1c7885496b799206999bb8f6e65091 - + https://github.com/dotnet/aspnetcore-tooling - 216201b64a9d139defd5a884779ae53da8844f17 + df809abb8a1c7885496b799206999bb8f6e65091 https://github.com/dotnet/efcore @@ -57,284 +57,284 @@ https://github.com/dotnet/efcore c65bdd5f71b32a341fb4734e131fa3d9dd30128a - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/runtime - 487c940876b1932920454c44d2463d996cc8407c + 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 https://github.com/dotnet/arcade @@ -348,13 +348,13 @@ https://github.com/dotnet/arcade 8ccad075bbb0db445e03eed0a6073d27bdd4f31a - + https://github.com/dotnet/extensions - 519ef585cfa587010fc1b6d3051c7f67c0e3e2d6 + af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - + https://github.com/dotnet/roslyn - c59debd7a94d135fd96728b7992a5bf841fe9a99 + 8f010124a3a323b34f561d062025258668d91539 diff --git a/eng/Versions.props b/eng/Versions.props index 553da38bb1..174f302c9f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -64,82 +64,82 @@ 5.0.0-beta.20151.1 - 3.5.0-beta4-20128-01 + 3.5.0-beta4-20128-03 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 2.1.0-preview.2.20127.14 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 2.1.0-preview.2.20129.8 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 - 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20127.14 + 5.0.0-preview.2.20129.8 3.2.0-preview1.20067.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 - 5.0.0-preview.2.20128.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20151.1 5.0.0-preview.2.20152.1 5.0.0-preview.2.20152.1 @@ -149,10 +149,10 @@ 5.0.0-preview.2.20152.1 5.0.0-preview.2.20152.1 - 5.0.0-preview.2.20128.9 - 5.0.0-preview.2.20128.9 - 5.0.0-preview.2.20128.9 - 5.0.0-preview.2.20128.9 + 5.0.0-preview.2.20152.1 + 5.0.0-preview.2.20152.1 + 5.0.0-preview.2.20152.1 + 5.0.0-preview.2.20152.1 - 5.0.0-preview.2.20152.1 - 5.0.0-preview.2.20152.1 - 5.0.0-preview.2.20152.1 - 5.0.0-preview.2.20152.1 - 5.0.0-preview.2.20152.1 - 5.0.0-preview.2.20152.1 - 5.0.0-preview.2.20152.1 + 5.0.0-preview.2.20152.2 + 5.0.0-preview.2.20152.2 + 5.0.0-preview.2.20152.2 + 5.0.0-preview.2.20152.2 + 5.0.0-preview.2.20152.2 + 5.0.0-preview.2.20152.2 + 5.0.0-preview.2.20152.2 5.0.0-preview.2.20152.1 5.0.0-preview.2.20152.1 From b1a45eb8099b33d95cb0edcefab8cb8ec50f02c8 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Tue, 3 Mar 2020 17:17:06 +1300 Subject: [PATCH 33/50] Update BenchmarkDotNet and add Http2Connection benchmark (#19482) --- eng/Versions.props | 2 +- .../IIS.Performance/FirstRequestConfig.cs | 4 +- .../Http2ConnectionBenchmark.cs | 101 ++++++++++++++++++ ...pNetCore.Server.Kestrel.Performance.csproj | 4 +- .../Mocks/MockDuplexPipe.cs | 19 ++++ .../Mocks/MockSystemClock.cs | 15 +++ .../Mocks/MockTimeoutControl.cs | 62 +++++++++++ .../Mocks/NullPipeWriter.cs | 3 +- .../test/PipeWriterHttp2FrameExtensions.cs | 78 ++++++++++++++ .../Http2/Http2TestBase.cs | 80 +++----------- .../BenchmarkRunner/DefaultCoreConfig.cs | 2 +- .../DefaultCorePerfLabConfig.cs | 13 +-- .../DefaultCoreValidationConfig.cs | 4 +- .../ParamsDisplayInfoColumn.cs | 8 +- 14 files changed, 308 insertions(+), 87 deletions(-) create mode 100644 src/Servers/Kestrel/perf/Kestrel.Performance/Http2ConnectionBenchmark.cs create mode 100644 src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockDuplexPipe.cs create mode 100644 src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockSystemClock.cs create mode 100644 src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockTimeoutControl.cs create mode 100644 src/Servers/Kestrel/shared/test/PipeWriterHttp2FrameExtensions.cs diff --git a/eng/Versions.props b/eng/Versions.props index f11bb92706..567b25138b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -220,7 +220,7 @@ 3.1.3 0.9.9 - 0.10.13 + 0.12.0 4.2.1 4.2.1 3.8.0 diff --git a/src/Servers/IIS/IIS/benchmarks/IIS.Performance/FirstRequestConfig.cs b/src/Servers/IIS/IIS/benchmarks/IIS.Performance/FirstRequestConfig.cs index 727746871f..c048b28f8d 100644 --- a/src/Servers/IIS/IIS/benchmarks/IIS.Performance/FirstRequestConfig.cs +++ b/src/Servers/IIS/IIS/benchmarks/IIS.Performance/FirstRequestConfig.cs @@ -27,10 +27,10 @@ namespace BenchmarkDotNet.Attributes Add(JitOptimizationsValidator.FailOnError); - Add(Job.Core + Add(Job.Default .With(CsProjCoreToolchain.From(NetCoreAppSettings.NetCoreApp21)) .With(new GcMode { Server = true }) - .WithTargetCount(10) + .WithIterationCount(10) .WithInvocationCount(1) .WithUnrollFactor(1) .With(RunStrategy.ColdStart)); diff --git a/src/Servers/Kestrel/perf/Kestrel.Performance/Http2ConnectionBenchmark.cs b/src/Servers/Kestrel/perf/Kestrel.Performance/Http2ConnectionBenchmark.cs new file mode 100644 index 0000000000..1438fb5379 --- /dev/null +++ b/src/Servers/Kestrel/perf/Kestrel.Performance/Http2ConnectionBenchmark.cs @@ -0,0 +1,101 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Buffers; +using System.Collections.Generic; +using System.IO.Pipelines; +using System.Net.Http.HPack; +using System.Threading.Tasks; +using BenchmarkDotNet.Attributes; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Features; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; +using Microsoft.AspNetCore.Testing; +using Microsoft.Extensions.Logging.Abstractions; +using Microsoft.Extensions.Primitives; +using Microsoft.Net.Http.Headers; + +namespace Microsoft.AspNetCore.Server.Kestrel.Performance +{ + public class Http2ConnectionBenchmark + { + private MemoryPool _memoryPool; + private Pipe _pipe; + private HttpRequestHeaders _httpRequestHeaders; + private Http2Connection _connection; + private Http2HeadersEnumerator _requestHeadersEnumerator; + private int _currentStreamId; + private HPackEncoder _hpackEncoder; + private byte[] _headersBuffer; + + [GlobalSetup] + public void GlobalSetup() + { + _memoryPool = SlabMemoryPoolFactory.Create(); + + var options = new PipeOptions(_memoryPool, readerScheduler: PipeScheduler.Inline, writerScheduler: PipeScheduler.Inline, useSynchronizationContext: false); + _pipe = new Pipe(options); + + _httpRequestHeaders = new HttpRequestHeaders(); + _httpRequestHeaders.Append(HeaderNames.Method, new StringValues("GET")); + _httpRequestHeaders.Append(HeaderNames.Path, new StringValues("/")); + _httpRequestHeaders.Append(HeaderNames.Scheme, new StringValues("http")); + _httpRequestHeaders.Append(HeaderNames.Authority, new StringValues("localhost:80")); + + _hpackEncoder = new HPackEncoder(); + _headersBuffer = new byte[1024 * 16]; + + var serviceContext = new ServiceContext + { + DateHeaderValueManager = new DateHeaderValueManager(), + ServerOptions = new KestrelServerOptions(), + Log = new KestrelTrace(NullLogger.Instance), + SystemClock = new MockSystemClock() + }; + serviceContext.ServerOptions.Limits.Http2.MaxStreamsPerConnection = int.MaxValue; + serviceContext.DateHeaderValueManager.OnHeartbeat(default); + + _connection = new Http2Connection(new HttpConnectionContext + { + MemoryPool = _memoryPool, + ConnectionId = "TestConnectionId", + Protocols = Core.HttpProtocols.Http2, + Transport = new MockDuplexPipe(_pipe.Reader, new NullPipeWriter()), + ServiceContext = serviceContext, + ConnectionFeatures = new FeatureCollection(), + TimeoutControl = new MockTimeoutControl(), + }); + + _requestHeadersEnumerator = new Http2HeadersEnumerator(); + + _currentStreamId = 1; + + _ = _connection.ProcessRequestsAsync(new DummyApplication()); + + _pipe.Writer.Write(Http2Connection.ClientPreface); + PipeWriterHttp2FrameExtensions.WriteSettings(_pipe.Writer, new Http2PeerSettings()); + _pipe.Writer.FlushAsync().GetAwaiter().GetResult(); + } + + [Benchmark] + public async Task EmptyRequest() + { + _requestHeadersEnumerator.Initialize(_httpRequestHeaders); + PipeWriterHttp2FrameExtensions.WriteStartStream(_pipe.Writer, streamId: _currentStreamId, _requestHeadersEnumerator, _hpackEncoder, _headersBuffer, endStream: true); + _currentStreamId += 2; + await _pipe.Writer.FlushAsync(); + } + + [GlobalCleanup] + public void Dispose() + { + _pipe.Writer.Complete(); + _memoryPool?.Dispose(); + } + } +} diff --git a/src/Servers/Kestrel/perf/Kestrel.Performance/Microsoft.AspNetCore.Server.Kestrel.Performance.csproj b/src/Servers/Kestrel/perf/Kestrel.Performance/Microsoft.AspNetCore.Server.Kestrel.Performance.csproj index 07c9d49f68..ef22ae3002 100644 --- a/src/Servers/Kestrel/perf/Kestrel.Performance/Microsoft.AspNetCore.Server.Kestrel.Performance.csproj +++ b/src/Servers/Kestrel/perf/Kestrel.Performance/Microsoft.AspNetCore.Server.Kestrel.Performance.csproj @@ -1,4 +1,4 @@ - + $(DefaultNetCoreTargetFramework) @@ -10,6 +10,8 @@ + + diff --git a/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockDuplexPipe.cs b/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockDuplexPipe.cs new file mode 100644 index 0000000000..86f6dc3112 --- /dev/null +++ b/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockDuplexPipe.cs @@ -0,0 +1,19 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.IO.Pipelines; + +namespace Microsoft.AspNetCore.Server.Kestrel.Performance +{ + internal class MockDuplexPipe : IDuplexPipe + { + public MockDuplexPipe(PipeReader input, PipeWriter output) + { + Input = input; + Output = output; + } + + public PipeReader Input { get; } + public PipeWriter Output { get; } + } +} diff --git a/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockSystemClock.cs b/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockSystemClock.cs new file mode 100644 index 0000000000..960d2cba95 --- /dev/null +++ b/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockSystemClock.cs @@ -0,0 +1,15 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; + +namespace Microsoft.AspNetCore.Server.Kestrel.Performance +{ + internal class MockSystemClock : ISystemClock + { + public DateTimeOffset UtcNow { get; } + public long UtcNowTicks { get; } + public DateTimeOffset UtcNowUnsynchronized { get; } + } +} diff --git a/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockTimeoutControl.cs b/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockTimeoutControl.cs new file mode 100644 index 0000000000..54865db3c3 --- /dev/null +++ b/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/MockTimeoutControl.cs @@ -0,0 +1,62 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; + +namespace Microsoft.AspNetCore.Server.Kestrel.Performance +{ + internal class MockTimeoutControl : ITimeoutControl + { + public TimeoutReason TimerReason { get; } = TimeoutReason.KeepAlive; + + public void BytesRead(long count) + { + } + + public void BytesWrittenToBuffer(MinDataRate minRate, long count) + { + } + + public void CancelTimeout() + { + } + + public void InitializeHttp2(InputFlowControl connectionInputFlowControl) + { + } + + public void ResetTimeout(long ticks, TimeoutReason timeoutReason) + { + } + + public void SetTimeout(long ticks, TimeoutReason timeoutReason) + { + } + + public void StartRequestBody(MinDataRate minRate) + { + } + + public void StartTimingRead() + { + } + + public void StartTimingWrite() + { + } + + public void StopRequestBody() + { + } + + public void StopTimingRead() + { + } + + public void StopTimingWrite() + { + } + } +} diff --git a/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/NullPipeWriter.cs b/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/NullPipeWriter.cs index 24adcba48a..c982ec4902 100644 --- a/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/NullPipeWriter.cs +++ b/src/Servers/Kestrel/perf/Kestrel.Performance/Mocks/NullPipeWriter.cs @@ -10,7 +10,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance { internal class NullPipeWriter : PipeWriter { - private byte[] _buffer = new byte[1024 * 128]; + // Should be large enough for any content attempting to write to the buffer + private readonly byte[] _buffer = new byte[1024 * 128]; public override void Advance(int bytes) { diff --git a/src/Servers/Kestrel/shared/test/PipeWriterHttp2FrameExtensions.cs b/src/Servers/Kestrel/shared/test/PipeWriterHttp2FrameExtensions.cs new file mode 100644 index 0000000000..beb76e1c55 --- /dev/null +++ b/src/Servers/Kestrel/shared/test/PipeWriterHttp2FrameExtensions.cs @@ -0,0 +1,78 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Buffers; +using System.Collections.Generic; +using System.IO.Pipelines; +using System.Net.Http.HPack; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2; + +namespace Microsoft.AspNetCore.Testing +{ + internal static class PipeWriterHttp2FrameExtensions + { + public static void WriteSettings(this PipeWriter writer, Http2PeerSettings clientSettings) + { + var frame = new Http2Frame(); + frame.PrepareSettings(Http2SettingsFrameFlags.NONE); + var settings = clientSettings.GetNonProtocolDefaults(); + var payload = new byte[settings.Count * Http2FrameReader.SettingSize]; + frame.PayloadLength = payload.Length; + Http2FrameWriter.WriteSettings(settings, payload); + Http2FrameWriter.WriteHeader(frame, writer); + writer.Write(payload); + } + + public static void WriteStartStream(this PipeWriter writer, int streamId, Http2HeadersEnumerator headers, HPackEncoder hpackEncoder, byte[] headerEncodingBuffer, bool endStream) + { + var frame = new Http2Frame(); + frame.PrepareHeaders(Http2HeadersFrameFlags.NONE, streamId); + + var buffer = headerEncodingBuffer.AsSpan(); + var done = hpackEncoder.BeginEncode(headers, buffer, out var length); + frame.PayloadLength = length; + + if (done) + { + frame.HeadersFlags = Http2HeadersFrameFlags.END_HEADERS; + } + + if (endStream) + { + frame.HeadersFlags |= Http2HeadersFrameFlags.END_STREAM; + } + + Http2FrameWriter.WriteHeader(frame, writer); + writer.Write(buffer.Slice(0, length)); + + while (!done) + { + frame.PrepareContinuation(Http2ContinuationFrameFlags.NONE, streamId); + + done = hpackEncoder.Encode(buffer, out length); + frame.PayloadLength = length; + + if (done) + { + frame.ContinuationFlags = Http2ContinuationFrameFlags.END_HEADERS; + } + + Http2FrameWriter.WriteHeader(frame, writer); + writer.Write(buffer.Slice(0, length)); + } + } + + public static void WriteData(this PipeWriter writer, int streamId, Memory data, bool endStream) + { + var frame = new Http2Frame(); + + frame.PrepareData(streamId); + frame.PayloadLength = data.Length; + frame.DataFlags = endStream ? Http2DataFrameFlags.END_STREAM : Http2DataFrameFlags.NONE; + + Http2FrameWriter.WriteHeader(frame, writer); + writer.Write(data.Span); + } + } +} diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TestBase.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TestBase.cs index de1a57beb2..68076af39c 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TestBase.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TestBase.cs @@ -501,56 +501,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); _runningStreams[streamId] = tcs; - var frame = new Http2Frame(); - frame.PrepareHeaders(Http2HeadersFrameFlags.NONE, streamId); - - var buffer = _headerEncodingBuffer.AsSpan(); - var done = _hpackEncoder.BeginEncode(GetHeadersEnumerator(headers), buffer, out var length); - frame.PayloadLength = length; - - if (done) - { - frame.HeadersFlags = Http2HeadersFrameFlags.END_HEADERS; - } - - if (endStream) - { - frame.HeadersFlags |= Http2HeadersFrameFlags.END_STREAM; - } - - Http2FrameWriter.WriteHeader(frame, writableBuffer); - writableBuffer.Write(buffer.Slice(0, length)); - - while (!done) - { - frame.PrepareContinuation(Http2ContinuationFrameFlags.NONE, streamId); - - done = _hpackEncoder.Encode(buffer, out length); - frame.PayloadLength = length; - - if (done) - { - frame.ContinuationFlags = Http2ContinuationFrameFlags.END_HEADERS; - } - - Http2FrameWriter.WriteHeader(frame, writableBuffer); - writableBuffer.Write(buffer.Slice(0, length)); - } - + PipeWriterHttp2FrameExtensions.WriteStartStream(writableBuffer, streamId, GetHeadersEnumerator(headers), _hpackEncoder, _headerEncodingBuffer, endStream); return FlushAsync(writableBuffer); } - private static Http2HeadersEnumerator GetHeadersEnumerator(IEnumerable> headers) - { - var groupedHeaders = headers - .GroupBy(k => k.Key) - .ToDictionary(g => g.Key, g => new StringValues(g.Select(gg => gg.Value).ToArray())); - - var enumerator = new Http2HeadersEnumerator(); - enumerator.Initialize(groupedHeaders); - return enumerator; - } - /* https://tools.ietf.org/html/rfc7540#section-6.2 +---------------+ |Pad Length? (8)| @@ -704,15 +658,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests protected async Task SendSettingsAsync() { - var writableBuffer = _pair.Application.Output; - var frame = new Http2Frame(); - frame.PrepareSettings(Http2SettingsFrameFlags.NONE); - var settings = _clientSettings.GetNonProtocolDefaults(); - var payload = new byte[settings.Count * Http2FrameReader.SettingSize]; - frame.PayloadLength = payload.Length; - Http2FrameWriter.WriteSettings(settings, payload); - Http2FrameWriter.WriteHeader(frame, writableBuffer); - await SendAsync(payload); + PipeWriterHttp2FrameExtensions.WriteSettings(_pair.Application.Output, _clientSettings); + await FlushAsync(_pair.Application.Output); } protected async Task SendSettingsAckWithInvalidLengthAsync(int length) @@ -890,6 +837,17 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests return done; } + private Http2HeadersEnumerator GetHeadersEnumerator(IEnumerable> headers) + { + var dictionary = headers + .GroupBy(g => g.Key) + .ToDictionary(g => g.Key, g => new StringValues(g.Select(values => values.Value).ToArray())); + + var headersEnumerator = new Http2HeadersEnumerator(); + headersEnumerator.Initialize(dictionary); + return headersEnumerator; + } + internal Task SendEmptyContinuationFrameAsync(int streamId, Http2ContinuationFrameFlags flags) { var outputWriter = _pair.Application.Output; @@ -923,14 +881,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests protected Task SendDataAsync(int streamId, Memory data, bool endStream) { var outputWriter = _pair.Application.Output; - var frame = new Http2Frame(); - - frame.PrepareData(streamId); - frame.PayloadLength = data.Length; - frame.DataFlags = endStream ? Http2DataFrameFlags.END_STREAM : Http2DataFrameFlags.NONE; - - Http2FrameWriter.WriteHeader(frame, outputWriter); - return SendAsync(data.Span); + PipeWriterHttp2FrameExtensions.WriteData(outputWriter, streamId, data, endStream); + return FlushAsync(outputWriter); } protected async Task SendDataWithPaddingAsync(int streamId, Memory data, byte padLength, bool endStream) diff --git a/src/Shared/BenchmarkRunner/DefaultCoreConfig.cs b/src/Shared/BenchmarkRunner/DefaultCoreConfig.cs index 0691936c35..e5b0c9b43b 100644 --- a/src/Shared/BenchmarkRunner/DefaultCoreConfig.cs +++ b/src/Shared/BenchmarkRunner/DefaultCoreConfig.cs @@ -27,7 +27,7 @@ namespace BenchmarkDotNet.Attributes Add(JitOptimizationsValidator.FailOnError); - Add(Job.Core + Add(Job.Default #if NETCOREAPP2_1 .With(CsProjCoreToolchain.From(NetCoreAppSettings.NetCoreApp21)) #elif NETCOREAPP3_0 diff --git a/src/Shared/BenchmarkRunner/DefaultCorePerfLabConfig.cs b/src/Shared/BenchmarkRunner/DefaultCorePerfLabConfig.cs index 5cc809e166..5c6ba7ac3b 100644 --- a/src/Shared/BenchmarkRunner/DefaultCorePerfLabConfig.cs +++ b/src/Shared/BenchmarkRunner/DefaultCorePerfLabConfig.cs @@ -22,10 +22,7 @@ namespace BenchmarkDotNet.Attributes Add(MemoryDiagnoser.Default); Add(StatisticColumn.OperationsPerSecond); Add(new ParamsSummaryColumn()); - Add(DefaultColumnProviders.Statistics, DefaultColumnProviders.Diagnosers, DefaultColumnProviders.Target); - - // TODO: When upgrading to BDN 0.11.1, use Add(DefaultColumnProviders.Descriptor); - // DefaultColumnProviders.Target is deprecated + Add(DefaultColumnProviders.Statistics, DefaultColumnProviders.Metrics, DefaultColumnProviders.Descriptor); Add(JitOptimizationsValidator.FailOnError); @@ -36,13 +33,7 @@ namespace BenchmarkDotNet.Attributes Add(new CsvExporter( CsvSeparator.Comma, - new Reports.SummaryStyle - { - PrintUnitsInHeader = true, - PrintUnitsInContent = false, - TimeUnit = Horology.TimeUnit.Microsecond, - SizeUnit = SizeUnit.KB - })); + new Reports.SummaryStyle(printUnitsInHeader: true, printUnitsInContent: false, timeUnit: Horology.TimeUnit.Microsecond, sizeUnit: SizeUnit.KB))); } } } diff --git a/src/Shared/BenchmarkRunner/DefaultCoreValidationConfig.cs b/src/Shared/BenchmarkRunner/DefaultCoreValidationConfig.cs index 5a90929cff..3faf5ac1cb 100644 --- a/src/Shared/BenchmarkRunner/DefaultCoreValidationConfig.cs +++ b/src/Shared/BenchmarkRunner/DefaultCoreValidationConfig.cs @@ -4,7 +4,7 @@ using BenchmarkDotNet.Configs; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Loggers; -using BenchmarkDotNet.Toolchains.InProcess; +using BenchmarkDotNet.Toolchains.InProcess.NoEmit; namespace BenchmarkDotNet.Attributes { @@ -14,7 +14,7 @@ namespace BenchmarkDotNet.Attributes { Add(ConsoleLogger.Default); - Add(Job.Dry.With(InProcessToolchain.Instance)); + Add(Job.Dry.With(InProcessNoEmitToolchain.Instance)); } } } diff --git a/src/Shared/BenchmarkRunner/ParamsDisplayInfoColumn.cs b/src/Shared/BenchmarkRunner/ParamsDisplayInfoColumn.cs index b246e21c2e..2267de01a6 100644 --- a/src/Shared/BenchmarkRunner/ParamsDisplayInfoColumn.cs +++ b/src/Shared/BenchmarkRunner/ParamsDisplayInfoColumn.cs @@ -11,8 +11,8 @@ namespace BenchmarkDotNet.Attributes { public string Id => nameof(ParamsSummaryColumn); public string ColumnName { get; } = "Params"; - public bool IsDefault(Summary summary, Benchmark benchmark) => false; - public string GetValue(Summary summary, Benchmark benchmark) => benchmark.Parameters.DisplayInfo; + public bool IsDefault(Summary summary, BenchmarkCase benchmark) => false; + public string GetValue(Summary summary, BenchmarkCase benchmark) => benchmark.Parameters.DisplayInfo; public bool IsAvailable(Summary summary) => true; public bool AlwaysShow => true; public ColumnCategory Category => ColumnCategory.Params; @@ -20,7 +20,7 @@ namespace BenchmarkDotNet.Attributes public override string ToString() => ColumnName; public bool IsNumeric => false; public UnitType UnitType => UnitType.Dimensionless; - public string GetValue(Summary summary, Benchmark benchmark, ISummaryStyle style) => GetValue(summary, benchmark); + public string GetValue(Summary summary, BenchmarkCase benchmark, SummaryStyle style) => GetValue(summary, benchmark); public string Legend => $"Summary of all parameter values"; } -} \ No newline at end of file +} From 46460f00709d59b811ad989582460b4f492b38db Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 2 Mar 2020 20:43:48 -0800 Subject: [PATCH 34/50] Revert "[Helix] Reenable some Templates tests 2.0 (#19383)" (#19519) This reverts commit 5e2a7726c63b7d6e4b6aca09bfac756679b0c000. --- eng/helix/content/runtests.cmd | 11 ------ eng/helix/content/runtests.sh | 14 -------- eng/targets/Helix.targets | 4 +-- src/ProjectTemplates/test/Helpers/Project.cs | 36 +++++-------------- .../test/IdentityUIPackageTest.cs | 4 ++- src/ProjectTemplates/test/MvcTemplateTest.cs | 6 ++-- .../test/RazorClassLibraryTemplateTest.cs | 4 ++- .../test/RazorPagesTemplateTest.cs | 6 ++-- .../test/WorkerTemplateTest.cs | 3 +- 9 files changed, 26 insertions(+), 62 deletions(-) diff --git a/eng/helix/content/runtests.cmd b/eng/helix/content/runtests.cmd index 4917f46c0e..73cf658c18 100644 --- a/eng/helix/content/runtests.cmd +++ b/eng/helix/content/runtests.cmd @@ -9,7 +9,6 @@ set $runtimeVersion=%3 set $helixQueue=%4 set $arch=%5 set $quarantined=%6 -set $efVersion=%7 set DOTNET_HOME=%HELIX_CORRELATION_PAYLOAD%\sdk set DOTNET_ROOT=%DOTNET_HOME%\%$arch% @@ -25,14 +24,6 @@ powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePo if EXIST ".\Microsoft.AspNetCore.App" ( echo "Found Microsoft.AspNetCore.App, copying to %DOTNET_ROOT%\shared\Microsoft.AspNetCore.App\%runtimeVersion%" xcopy /i /y ".\Microsoft.AspNetCore.App" %DOTNET_ROOT%\shared\Microsoft.AspNetCore.App\%runtimeVersion%\ - - echo "Adding current directory to nuget sources: %HELIX_WORKITEM_ROOT%" - dotnet nuget add source %HELIX_WORKITEM_ROOT% - dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json - dotnet nuget list source - dotnet tool install dotnet-ef --global --version %$efVersion% - - set PATH=%PATH%;%DOTNET_CLI_HOME%\.dotnet\tools ) echo "Current Directory: %HELIX_WORKITEM_ROOT%" @@ -40,8 +31,6 @@ set HELIX=%$helixQueue% set HELIX_DIR=%HELIX_WORKITEM_ROOT% set NUGET_FALLBACK_PACKAGES=%HELIX_DIR% set NUGET_RESTORE=%HELIX_DIR%\nugetRestore -set DotNetEfFullPath=%HELIX_DIR%\nugetRestore\dotnet-ef\%$efVersion%\tools\netcoreapp3.1\any\dotnet-ef.exe -echo "Set DotNetEfFullPath: %DotNetEfFullPath%" echo "Setting HELIX_DIR: %HELIX_DIR%" echo Creating nuget restore directory: %NUGET_RESTORE% mkdir %NUGET_RESTORE% diff --git a/eng/helix/content/runtests.sh b/eng/helix/content/runtests.sh index a82a5aa0f4..c31297d587 100644 --- a/eng/helix/content/runtests.sh +++ b/eng/helix/content/runtests.sh @@ -6,7 +6,6 @@ dotnet_runtime_version="$3" helix_queue_name="$4" target_arch="$5" quarantined="$6" -efVersion="$7" RESET="\033[0m" RED="\033[0;31m" @@ -34,8 +33,6 @@ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 export helix="$helix_queue_name" export HELIX_DIR="$DIR" export NUGET_FALLBACK_PACKAGES="$DIR" -export DotNetEfFullPath=$DIR\nugetRestore\dotnet-ef\$efVersion\tools\netcoreapp3.1\any\dotnet-ef.dll -echo "Set DotNetEfFullPath: $DotNetEfFullPath" export NUGET_RESTORE="$DIR/nugetRestore" echo "Creating nugetRestore directory: $NUGET_RESTORE" mkdir $NUGET_RESTORE @@ -98,17 +95,6 @@ if [ -d "Microsoft.AspNetCore.App" ] then echo "Found Microsoft.AspNetCore.App directory, copying to $DOTNET_ROOT/shared/Microsoft.AspNetCore.App/$dotnet_runtime_version." cp -r Microsoft.AspNetCore.App $DOTNET_ROOT/shared/Microsoft.AspNetCore.App/$dotnet_runtime_version - - echo "Adding current directory to nuget sources: $DIR" - dotnet nuget add source $DIR - dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json - dotnet nuget list source - - dotnet tool install dotnet-ef --global --version $efVersion - - # Ensure tools are on on PATH - export PATH="$PATH:$DOTNET_CLI_HOME/.dotnet/tools" - fi if [ -e /proc/self/coredump_filter ]; then diff --git a/eng/targets/Helix.targets b/eng/targets/Helix.targets index 154ce92ee6..0084984353 100644 --- a/eng/targets/Helix.targets +++ b/eng/targets/Helix.targets @@ -120,8 +120,8 @@ Usage: dotnet msbuild /t:Helix src/MyTestProject.csproj $(TargetFileName) @(HelixPreCommand) @(HelixPostCommand) - call runtests.cmd $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppRuntimeVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(DotnetEfPackageVersion) - ./runtests.sh $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppRuntimeVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(DotnetEfPackageVersion) + call runtests.cmd $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppRuntimeVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) + ./runtests.sh $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppRuntimeVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(HelixCommand) $(HelixTimeout) diff --git a/src/ProjectTemplates/test/Helpers/Project.cs b/src/ProjectTemplates/test/Helpers/Project.cs index 3fdcdf9d0c..28a9bdd917 100644 --- a/src/ProjectTemplates/test/Helpers/Project.cs +++ b/src/ProjectTemplates/test/Helpers/Project.cs @@ -7,7 +7,6 @@ using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; -using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.CommandLineUtils; @@ -29,11 +28,12 @@ namespace Templates.Test.Helpers ? GetAssemblyMetadata("ArtifactsLogDir") : Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "logs"); - public static string DotNetEfFullPath => (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath"))) + // FIGURE OUT EF PATH + public static string DotNetEfFullPath => (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) ? typeof(ProjectFactoryFixture).Assembly.GetCustomAttributes() .First(attribute => attribute.Key == "DotNetEfFullPath") .Value - : Environment.GetEnvironmentVariable("DotNetEfFullPath"); + : Path.Combine("NuGetPackageRoot", "dotnet-ef/$(DotnetEfPackageVersion)/tools/netcoreapp3.1/any/dotnet-ef.dll"); public SemaphoreSlim DotNetNewLock { get; set; } public SemaphoreSlim NodeLock { get; set; } @@ -306,24 +306,14 @@ namespace Templates.Test.Helpers internal async Task RunDotNetEfCreateMigrationAsync(string migrationName) { - var args = $"--verbose --no-build migrations add {migrationName}"; - + var args = $"\"{DotNetEfFullPath}\" --verbose --no-build migrations add {migrationName}"; + // Only run one instance of 'dotnet new' at once, as a workaround for // https://github.com/aspnet/templating/issues/63 await DotNetNewLock.WaitAsync(); try { - var command = DotNetMuxer.MuxerPathOrDefault(); - if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath"))) - { - args = $"\"{DotNetEfFullPath}\" " + args; - } - else - { - command = "dotnet-ef"; - } - - var result = ProcessEx.Run(Output, TemplateOutputDir, command, args); + var result = ProcessEx.Run(Output, TemplateOutputDir, DotNetMuxer.MuxerPathOrDefault(), args); await result.Exited; return result; } @@ -335,24 +325,14 @@ namespace Templates.Test.Helpers internal async Task RunDotNetEfUpdateDatabaseAsync() { - var args = "--verbose --no-build database update"; + var args = $"\"{DotNetEfFullPath}\" --verbose --no-build database update"; // Only run one instance of 'dotnet new' at once, as a workaround for // https://github.com/aspnet/templating/issues/63 await DotNetNewLock.WaitAsync(); try { - var command = DotNetMuxer.MuxerPathOrDefault(); - if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath"))) - { - args = $"\"{DotNetEfFullPath}\" " + args; - } - else - { - command = "dotnet-ef"; - } - - var result = ProcessEx.Run(Output, TemplateOutputDir, command, args); + var result = ProcessEx.Run(Output, TemplateOutputDir, DotNetMuxer.MuxerPathOrDefault(), args); await result.Exited; return result; } diff --git a/src/ProjectTemplates/test/IdentityUIPackageTest.cs b/src/ProjectTemplates/test/IdentityUIPackageTest.cs index deede64521..fe794a3629 100644 --- a/src/ProjectTemplates/test/IdentityUIPackageTest.cs +++ b/src/ProjectTemplates/test/IdentityUIPackageTest.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.IO; using System.Net; using System.Threading.Tasks; +using Microsoft.AspNetCore.Testing; using Templates.Test.Helpers; using Xunit; using Xunit.Abstractions; @@ -117,8 +118,9 @@ namespace Templates.Test "Identity/lib/jquery-validation-unobtrusive/LICENSE.txt", }; - [Theory] + [ConditionalTheory] [MemberData(nameof(MSBuildIdentityUIPackageOptions))] + [SkipOnHelix("ef restore no worky")] public async Task IdentityUIPackage_WorksWithDifferentOptions(IDictionary packageOptions, string versionValidator, string[] expectedFiles) { Project = await ProjectFactory.GetOrCreateProject("identityuipackage" + string.Concat(packageOptions.Values), Output); diff --git a/src/ProjectTemplates/test/MvcTemplateTest.cs b/src/ProjectTemplates/test/MvcTemplateTest.cs index 0dc0023bb9..271aed575b 100644 --- a/src/ProjectTemplates/test/MvcTemplateTest.cs +++ b/src/ProjectTemplates/test/MvcTemplateTest.cs @@ -104,9 +104,10 @@ namespace Templates.Test } } - [Theory] + [ConditionalTheory] [InlineData(true)] [InlineData(false)] + [SkipOnHelix("ef restore no worky")] public async Task MvcTemplate_IndividualAuth(bool useLocalDB) { Project = await ProjectFactory.GetOrCreateProject("mvcindividual" + (useLocalDB ? "uld" : ""), Output); @@ -221,7 +222,8 @@ namespace Templates.Test } } - [Fact] + [ConditionalFact] + [SkipOnHelix("razor compilation restore no worky")] public async Task MvcTemplate_RazorRuntimeCompilation_BuildsAndPublishes() { Project = await ProjectFactory.GetOrCreateProject("mvc_rc", Output); diff --git a/src/ProjectTemplates/test/RazorClassLibraryTemplateTest.cs b/src/ProjectTemplates/test/RazorClassLibraryTemplateTest.cs index 0d02a56f8f..f8d6bd65b5 100644 --- a/src/ProjectTemplates/test/RazorClassLibraryTemplateTest.cs +++ b/src/ProjectTemplates/test/RazorClassLibraryTemplateTest.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using Templates.Test.Helpers; using Xunit; using Xunit.Abstractions; +using Microsoft.AspNetCore.Testing; namespace Templates.Test { @@ -40,7 +41,8 @@ namespace Templates.Test Assert.True(0 == buildResult.ExitCode, ErrorMessages.GetFailedProcessMessage("build", Project, buildResult)); } - [Fact] + [ConditionalFact] + [SkipOnHelix("restore no worky")] public async Task RazorClassLibraryTemplateAsync() { Project = await ProjectFactory.GetOrCreateProject("razorclasslib", Output); diff --git a/src/ProjectTemplates/test/RazorPagesTemplateTest.cs b/src/ProjectTemplates/test/RazorPagesTemplateTest.cs index a0a57e48a9..73e4a5da52 100644 --- a/src/ProjectTemplates/test/RazorPagesTemplateTest.cs +++ b/src/ProjectTemplates/test/RazorPagesTemplateTest.cs @@ -94,9 +94,10 @@ namespace Templates.Test } } - [Theory] + [ConditionalTheory] [InlineData(false)] [InlineData(true)] + [SkipOnHelix("ef restore no worky")] public async Task RazorPagesTemplate_IndividualAuth(bool useLocalDB) { Project = await ProjectFactory.GetOrCreateProject("razorpagesindividual" + (useLocalDB ? "uld" : ""), Output); @@ -211,7 +212,8 @@ namespace Templates.Test } } - [Fact] + [ConditionalFact] + [SkipOnHelix("runtime compliation restore no worky")] public async Task RazorPagesTemplate_RazorRuntimeCompilation_BuildsAndPublishes() { Project = await ProjectFactory.GetOrCreateProject("razorpages_rc", Output); diff --git a/src/ProjectTemplates/test/WorkerTemplateTest.cs b/src/ProjectTemplates/test/WorkerTemplateTest.cs index 0a3bca6568..0299f17a11 100644 --- a/src/ProjectTemplates/test/WorkerTemplateTest.cs +++ b/src/ProjectTemplates/test/WorkerTemplateTest.cs @@ -21,7 +21,8 @@ namespace Templates.Test public ProjectFactoryFixture ProjectFactory { get; } public ITestOutputHelper Output { get; } - [Fact] + [ConditionalFact] + [SkipOnHelix("restore no worky")] public async Task WorkerTemplateAsync() { Project = await ProjectFactory.GetOrCreateProject("worker", Output); From 2c4d604cebc6821a5ba8ee06667605b9e4f6e890 Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Mon, 2 Mar 2020 22:06:13 -0800 Subject: [PATCH 35/50] Fix warning about dotnet_exe_path_tests.cpp (#19515) --- .../CommonLibTests/CommonLibTests.vcxproj | 6 +++++- .../CommonLibTests/dotnet_exe_path_tests.cpp | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Servers/IIS/AspNetCoreModuleV2/CommonLibTests/CommonLibTests.vcxproj b/src/Servers/IIS/AspNetCoreModuleV2/CommonLibTests/CommonLibTests.vcxproj index a49803ecce..9f24c25f67 100644 --- a/src/Servers/IIS/AspNetCoreModuleV2/CommonLibTests/CommonLibTests.vcxproj +++ b/src/Servers/IIS/AspNetCoreModuleV2/CommonLibTests/CommonLibTests.vcxproj @@ -98,6 +98,7 @@ EnableFastChecks MultiThreadedDebug Level3 + true $(MSBuildThisFileDirectory)include;%(AdditionalIncludeDirectories);..\RequestHandlerLib;..\IISLib;..\CommonLib;$(GoogleTestSubmoduleRoot)googletest\include;$(GoogleTestSubmoduleRoot)googlemock\include;...\AspNetCore\Inc;..\InProcessRequestHandler\ /D "_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING" stdcpp17 @@ -125,6 +126,7 @@ EnableFastChecks MultiThreadedDebug Level3 + true $(MSBuildThisFileDirectory)include;%(AdditionalIncludeDirectories);..\RequestHandlerLib;..\IISLib;..\CommonLib;$(GoogleTestSubmoduleRoot)googletest\include;$(GoogleTestSubmoduleRoot)googlemock\include;...\AspNetCore\Inc;..\InProcessRequestHandler\ /D "_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING" stdcpp17 @@ -150,6 +152,7 @@ stdafx.h MultiThreaded Level3 + true ProgramDatabase $(MSBuildThisFileDirectory)include;%(AdditionalIncludeDirectories);..\RequestHandlerLib;..\IISLib;..\CommonLib;$(GoogleTestSubmoduleRoot)googletest\include;$(GoogleTestSubmoduleRoot)googlemock\include;...\AspNetCore\Inc;..\InProcessRequestHandler\ /D "_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING" @@ -179,6 +182,7 @@ stdafx.h MultiThreaded Level3 + true ProgramDatabase $(MSBuildThisFileDirectory)include;%(AdditionalIncludeDirectories);..\RequestHandlerLib;..\IISLib;..\CommonLib;$(GoogleTestSubmoduleRoot)googletest\include;$(GoogleTestSubmoduleRoot)googlemock\include;...\AspNetCore\Inc;..\InProcessRequestHandler\ /D "_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING" @@ -200,4 +204,4 @@ - \ No newline at end of file + diff --git a/src/Servers/IIS/AspNetCoreModuleV2/CommonLibTests/dotnet_exe_path_tests.cpp b/src/Servers/IIS/AspNetCoreModuleV2/CommonLibTests/dotnet_exe_path_tests.cpp index 1d767accde..b7b334059a 100644 --- a/src/Servers/IIS/AspNetCoreModuleV2/CommonLibTests/dotnet_exe_path_tests.cpp +++ b/src/Servers/IIS/AspNetCoreModuleV2/CommonLibTests/dotnet_exe_path_tests.cpp @@ -16,7 +16,6 @@ namespace InprocessTests TEST(Dotnet_EXE_Path_Tests, EndWith_dotnet) { - HostFxrResolver resolver; std::filesystem::path hostFxrDllPath; std::vector arguments; ErrorContext errorContext; From 21068e0a45875714a9189489301b67c31c2ecdfe Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Tue, 3 Mar 2020 09:57:24 -0800 Subject: [PATCH 36/50] Update shared code license headers (#19518) --- src/Shared/runtime/Http2/Hpack/DynamicTable.cs | 6 +++--- src/Shared/runtime/Http2/Hpack/H2StaticTable.cs | 6 +++--- src/Shared/runtime/Http2/Hpack/HPackDecoder.cs | 6 +++--- src/Shared/runtime/Http2/Hpack/HPackDecodingException.cs | 6 +++--- src/Shared/runtime/Http2/Hpack/HPackEncoder.cs | 6 +++--- src/Shared/runtime/Http2/Hpack/HPackEncodingException.cs | 6 +++--- src/Shared/runtime/Http2/Hpack/HeaderField.cs | 6 +++--- src/Shared/runtime/Http2/Hpack/Huffman.cs | 6 +++--- src/Shared/runtime/Http2/Hpack/HuffmanDecodingException.cs | 6 +++--- src/Shared/runtime/Http2/Hpack/IntegerDecoder.cs | 6 +++--- src/Shared/runtime/Http2/Hpack/IntegerEncoder.cs | 6 +++--- src/Shared/runtime/Http2/Hpack/StatusCodes.cs | 6 +++--- .../MsQuic/Internal/ResettableCompletionSource.cs | 6 +++++- .../test/Shared.Tests/runtime/Http2/DynamicTableTest.cs | 6 +++--- .../test/Shared.Tests/runtime/Http2/HPackDecoderTest.cs | 6 +++--- 15 files changed, 47 insertions(+), 43 deletions(-) diff --git a/src/Shared/runtime/Http2/Hpack/DynamicTable.cs b/src/Shared/runtime/Http2/Hpack/DynamicTable.cs index 22178acae7..5a8fdf170f 100644 --- a/src/Shared/runtime/Http2/Hpack/DynamicTable.cs +++ b/src/Shared/runtime/Http2/Hpack/DynamicTable.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. namespace System.Net.Http.HPack { diff --git a/src/Shared/runtime/Http2/Hpack/H2StaticTable.cs b/src/Shared/runtime/Http2/Hpack/H2StaticTable.cs index eeb1029119..52de5ee8a8 100644 --- a/src/Shared/runtime/Http2/Hpack/H2StaticTable.cs +++ b/src/Shared/runtime/Http2/Hpack/H2StaticTable.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Collections.Generic; using System.Text; diff --git a/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs b/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs index 997047f2c6..41eb1c6938 100644 --- a/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs +++ b/src/Shared/runtime/Http2/Hpack/HPackDecoder.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Buffers; using System.Diagnostics; diff --git a/src/Shared/runtime/Http2/Hpack/HPackDecodingException.cs b/src/Shared/runtime/Http2/Hpack/HPackDecodingException.cs index 63d80cbb9f..b30eba72b9 100644 --- a/src/Shared/runtime/Http2/Hpack/HPackDecodingException.cs +++ b/src/Shared/runtime/Http2/Hpack/HPackDecodingException.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Runtime.Serialization; diff --git a/src/Shared/runtime/Http2/Hpack/HPackEncoder.cs b/src/Shared/runtime/Http2/Hpack/HPackEncoder.cs index 2385834b30..ac321b6f0d 100644 --- a/src/Shared/runtime/Http2/Hpack/HPackEncoder.cs +++ b/src/Shared/runtime/Http2/Hpack/HPackEncoder.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Diagnostics; #if KESTREL diff --git a/src/Shared/runtime/Http2/Hpack/HPackEncodingException.cs b/src/Shared/runtime/Http2/Hpack/HPackEncodingException.cs index 397b313191..792c871837 100644 --- a/src/Shared/runtime/Http2/Hpack/HPackEncodingException.cs +++ b/src/Shared/runtime/Http2/Hpack/HPackEncodingException.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. namespace System.Net.Http.HPack { diff --git a/src/Shared/runtime/Http2/Hpack/HeaderField.cs b/src/Shared/runtime/Http2/Hpack/HeaderField.cs index f876204671..2384c71983 100644 --- a/src/Shared/runtime/Http2/Hpack/HeaderField.cs +++ b/src/Shared/runtime/Http2/Hpack/HeaderField.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Diagnostics; using System.Text; diff --git a/src/Shared/runtime/Http2/Hpack/Huffman.cs b/src/Shared/runtime/Http2/Hpack/Huffman.cs index 3cba01b1d2..c534e0c173 100644 --- a/src/Shared/runtime/Http2/Hpack/Huffman.cs +++ b/src/Shared/runtime/Http2/Hpack/Huffman.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Diagnostics; diff --git a/src/Shared/runtime/Http2/Hpack/HuffmanDecodingException.cs b/src/Shared/runtime/Http2/Hpack/HuffmanDecodingException.cs index 64352e9535..2442f02da0 100644 --- a/src/Shared/runtime/Http2/Hpack/HuffmanDecodingException.cs +++ b/src/Shared/runtime/Http2/Hpack/HuffmanDecodingException.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Runtime.Serialization; diff --git a/src/Shared/runtime/Http2/Hpack/IntegerDecoder.cs b/src/Shared/runtime/Http2/Hpack/IntegerDecoder.cs index dafa6c08b4..0841d69bf2 100644 --- a/src/Shared/runtime/Http2/Hpack/IntegerDecoder.cs +++ b/src/Shared/runtime/Http2/Hpack/IntegerDecoder.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Diagnostics; using System.Numerics; diff --git a/src/Shared/runtime/Http2/Hpack/IntegerEncoder.cs b/src/Shared/runtime/Http2/Hpack/IntegerEncoder.cs index f56ad0a85e..227fbf0a44 100644 --- a/src/Shared/runtime/Http2/Hpack/IntegerEncoder.cs +++ b/src/Shared/runtime/Http2/Hpack/IntegerEncoder.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Diagnostics; diff --git a/src/Shared/runtime/Http2/Hpack/StatusCodes.cs b/src/Shared/runtime/Http2/Hpack/StatusCodes.cs index f302e7339b..b701fa79f4 100644 --- a/src/Shared/runtime/Http2/Hpack/StatusCodes.cs +++ b/src/Shared/runtime/Http2/Hpack/StatusCodes.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Globalization; using System.Text; diff --git a/src/Shared/runtime/Quic/Implementations/MsQuic/Internal/ResettableCompletionSource.cs b/src/Shared/runtime/Quic/Implementations/MsQuic/Internal/ResettableCompletionSource.cs index 1db5dc67b4..4bcf0a917a 100644 --- a/src/Shared/runtime/Quic/Implementations/MsQuic/Internal/ResettableCompletionSource.cs +++ b/src/Shared/runtime/Quic/Implementations/MsQuic/Internal/ResettableCompletionSource.cs @@ -1,4 +1,8 @@ -using System.Threading.Tasks; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Threading.Tasks; using System.Threading.Tasks.Sources; namespace System.Net.Quic.Implementations.MsQuic.Internal diff --git a/src/Shared/test/Shared.Tests/runtime/Http2/DynamicTableTest.cs b/src/Shared/test/Shared.Tests/runtime/Http2/DynamicTableTest.cs index fe0e4c7ec5..4abe4c5e68 100644 --- a/src/Shared/test/Shared.Tests/runtime/Http2/DynamicTableTest.cs +++ b/src/Shared/test/Shared.Tests/runtime/Http2/DynamicTableTest.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Collections.Generic; using System.Diagnostics; diff --git a/src/Shared/test/Shared.Tests/runtime/Http2/HPackDecoderTest.cs b/src/Shared/test/Shared.Tests/runtime/Http2/HPackDecoderTest.cs index d7bd47845c..2afdb29901 100644 --- a/src/Shared/test/Shared.Tests/runtime/Http2/HPackDecoderTest.cs +++ b/src/Shared/test/Shared.Tests/runtime/Http2/HPackDecoderTest.cs @@ -1,6 +1,6 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. -// See THIRD-PARTY-NOTICES.TXT in the project root for license information. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. using System.Buffers; using System.Linq; From 3df570fac67a9a802aab083abc5712188c09aa90 Mon Sep 17 00:00:00 2001 From: William Godbe Date: Tue, 3 Mar 2020 10:36:49 -0800 Subject: [PATCH 37/50] Don't reference checked-in platform manifest (#19529) --- src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj b/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj index 70fa2ddf5b..f695e4d3ee 100644 --- a/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj +++ b/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj @@ -53,8 +53,6 @@ This package is an internal implementation of the .NET Core SDK and is not meant $(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).0 $(ReferencePackSharedFxVersion)-$(VersionSuffix) - $(PlatformManifestOutputPath) - $(RepoRoot)eng\PlatformManifest.txt @@ -157,7 +155,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant - + From 065f0d001cd0c5c70860b8d12d95ada63b1bf4ea Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Wed, 4 Mar 2020 08:37:31 +1300 Subject: [PATCH 38/50] Only reset Http2Stream on stream completion (#19431) --- .../Core/src/Internal/Http/Http1Connection.cs | 2 +- .../Core/src/Internal/Http/HttpProtocol.cs | 7 ++- .../Core/src/Internal/Http2/Http2Stream.cs | 18 +++++-- .../Core/src/Internal/Http2/Http2StreamOfT.cs | 2 +- .../Core/src/Internal/Http3/Http3Stream.cs | 2 +- .../HttpProtocolFeatureCollectionTests.cs | 2 +- .../Http2/Http2ConnectionTests.cs | 47 +++++++++++++++++++ 7 files changed, 71 insertions(+), 9 deletions(-) diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/Http1Connection.cs b/src/Servers/Kestrel/Core/src/Internal/Http/Http1Connection.cs index 832d48cdce..ab341a8e53 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/Http1Connection.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/Http1Connection.cs @@ -45,7 +45,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http public Http1Connection(HttpConnectionContext context) { - Initialize(context); + Initialize(context, reset: true); _context = context; _parser = ServiceContext.HttpParser; diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs b/src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs index 539c386efa..87dc89f6d3 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs @@ -76,13 +76,16 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http private Stream _requestStreamInternal; private Stream _responseStreamInternal; - public void Initialize(HttpConnectionContext context) + public void Initialize(HttpConnectionContext context, bool reset) { _context = context; ServerOptions = ServiceContext.ServerOptions; - Reset(); + if (reset) + { + Reset(); + } HttpResponseControl = this; } diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs index df0190cba5..9853a184a0 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs @@ -33,9 +33,18 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 private StreamCompletionFlags _completionState; private readonly object _completionLock = new object(); - public void Initialize(Http2StreamContext context) + /// + /// Initialize the stream with the specified context. + /// + /// The context. + /// + /// A value indicating whether to reset the protocol instance. + /// We want to reset when the stream is created, and when the stream is returned to the pool. + /// The stream shouldn't be reset when fetched from the pool. + /// + public void InitializePooled(Http2StreamContext context, bool reset) { - base.Initialize(context); + base.Initialize(context, reset); _decrementCalled = false; _completionState = StreamCompletionFlags.None; @@ -71,7 +80,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 public void InitializeWithExistingContext(int streamId) { _context.StreamId = streamId; - Initialize(_context); + + // The stream was reset when it was completed. + // We don't want to reset it twice because reused headers will be discarded. + InitializePooled(_context, reset: false); } public int StreamId => _context.StreamId; diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2StreamOfT.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2StreamOfT.cs index 2ba223f43c..ef6c790f1d 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2StreamOfT.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2StreamOfT.cs @@ -13,7 +13,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 public Http2Stream(IHttpApplication application, Http2StreamContext context) { - Initialize(context); + InitializePooled(context, reset: true); _application = application; } diff --git a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs index 6518d00afd..3a4abf8590 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs @@ -52,7 +52,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http3 public Http3Stream(Http3Connection http3Connection, Http3StreamContext context) { - Initialize(context); + Initialize(context, reset: true); InputRemaining = null; diff --git a/src/Servers/Kestrel/Core/test/HttpProtocolFeatureCollectionTests.cs b/src/Servers/Kestrel/Core/test/HttpProtocolFeatureCollectionTests.cs index f62bad9117..789d93dfe5 100644 --- a/src/Servers/Kestrel/Core/test/HttpProtocolFeatureCollectionTests.cs +++ b/src/Servers/Kestrel/Core/test/HttpProtocolFeatureCollectionTests.cs @@ -251,7 +251,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests { public TestHttp2Stream(Http2StreamContext context) { - Initialize(context); + InitializePooled(context, reset: true); } public override void Execute() diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs index b0007a6a0d..486e046b7f 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs @@ -25,6 +25,53 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests { public class Http2ConnectionTests : Http2TestBase { + [Fact] + public async Task RequestHeaderStringReuse_MultipleStreams_KnownHeaderReused() + { + IEnumerable> requestHeaders = new[] + { + new KeyValuePair(HeaderNames.Method, "GET"), + new KeyValuePair(HeaderNames.Path, "/hello"), + new KeyValuePair(HeaderNames.Scheme, "http"), + new KeyValuePair(HeaderNames.Authority, "localhost:80"), + new KeyValuePair(HeaderNames.ContentType, "application/json") + }; + + await InitializeConnectionAsync(_readHeadersApplication); + + await StartStreamAsync(1, requestHeaders, endStream: true); + + await ExpectAsync(Http2FrameType.HEADERS, + withLength: 55, + withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), + withStreamId: 1); + + var contentType1 = _receivedHeaders["Content-Type"]; + + // Ping will trigger the stream to be returned to the pool so we can assert it + await SendPingAsync(Http2PingFrameFlags.NONE); + await ExpectAsync(Http2FrameType.PING, + withLength: 8, + withFlags: (byte)Http2PingFrameFlags.ACK, + withStreamId: 0); + + // Stream has been returned to the pool + Assert.Equal(1, _connection.StreamPool.Count); + + await StartStreamAsync(3, requestHeaders, endStream: true); + + await ExpectAsync(Http2FrameType.HEADERS, + withLength: 55, + withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), + withStreamId: 3); + + var contentType2 = _receivedHeaders["Content-Type"]; + + Assert.Same(contentType1, contentType2); + + await StopConnectionAsync(expectedLastStreamId: 3, ignoreNonGoAwayFrames: false); + } + [Fact] public async Task StreamPool_SingleStream_ReturnedToPool() { From 7e139c9b5f0dc4a2f6da5f413092f10365a4d644 Mon Sep 17 00:00:00 2001 From: Sedat Kapanoglu Date: Tue, 3 Mar 2020 15:45:50 -0800 Subject: [PATCH 39/50] Add HeaderNames.XRequestedWith = "X-Requested-With" (#19470) * Add HeaderNames.XRequestedWith = "X-Requested-With" X-Requested-With is the standard for differentiating AJAX requests and is commonly used. Having this in HeaderNames would prevent typos related to typing this header name. I couldn't find any rationale about excluding this but there might be legitimate reasons like discouraging the use of HTTP headers or differentiating AJAX requests, etc. Please reject this if that's the case. * Replace "X-Requested-With" references with HeaderNames.XRequestedWith The only remaining instance is WebSocketsTransport.cs in SignalR\clients\csharp\Http.Connections.Client which doesn't have Microsoft.Net in its references. I didn't want to impose a new dependency as its risky. * Fix the order of using statements * Add XRequestedWith to the ref assembly --- .../Headers/ref/Microsoft.Net.Http.Headers.netcoreapp.cs | 1 + src/Http/Headers/src/HeaderNames.cs | 1 + src/Identity/test/InMemory.Test/FunctionalTest.cs | 3 ++- .../Cookies/src/CookieAuthenticationEvents.cs | 8 ++++---- .../test/UnitTests/HttpConnectionTests.Transport.cs | 3 ++- .../server/SignalR/test/WebSocketsTransportTests.cs | 3 ++- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/Http/Headers/ref/Microsoft.Net.Http.Headers.netcoreapp.cs b/src/Http/Headers/ref/Microsoft.Net.Http.Headers.netcoreapp.cs index 41d44ad26d..74bfe68f38 100644 --- a/src/Http/Headers/ref/Microsoft.Net.Http.Headers.netcoreapp.cs +++ b/src/Http/Headers/ref/Microsoft.Net.Http.Headers.netcoreapp.cs @@ -200,6 +200,7 @@ namespace Microsoft.Net.Http.Headers public static readonly string WebSocketSubProtocols; public static readonly string WWWAuthenticate; public static readonly string XFrameOptions; + public static readonly string XRequestedWith; } public static partial class HeaderQuality { diff --git a/src/Http/Headers/src/HeaderNames.cs b/src/Http/Headers/src/HeaderNames.cs index 368cd8be46..5a30679fd8 100644 --- a/src/Http/Headers/src/HeaderNames.cs +++ b/src/Http/Headers/src/HeaderNames.cs @@ -88,5 +88,6 @@ namespace Microsoft.Net.Http.Headers public static readonly string WebSocketSubProtocols = "Sec-WebSocket-Protocol"; public static readonly string WWWAuthenticate = "WWW-Authenticate"; public static readonly string XFrameOptions = "X-Frame-Options"; + public static readonly string XRequestedWith = "X-Requested-With"; } } diff --git a/src/Identity/test/InMemory.Test/FunctionalTest.cs b/src/Identity/test/InMemory.Test/FunctionalTest.cs index b193bc16cd..a2609b4a43 100644 --- a/src/Identity/test/InMemory.Test/FunctionalTest.cs +++ b/src/Identity/test/InMemory.Test/FunctionalTest.cs @@ -18,6 +18,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Identity.Test; using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Net.Http.Headers; using Xunit; namespace Microsoft.AspNetCore.Identity.InMemory @@ -425,7 +426,7 @@ namespace Microsoft.AspNetCore.Identity.InMemory } if (ajaxRequest) { - request.Headers.Add("X-Requested-With", "XMLHttpRequest"); + request.Headers.Add(HeaderNames.XRequestedWith, "XMLHttpRequest"); } var transaction = new Transaction { diff --git a/src/Security/Authentication/Cookies/src/CookieAuthenticationEvents.cs b/src/Security/Authentication/Cookies/src/CookieAuthenticationEvents.cs index a6bb4e7d1c..a751c3eb53 100644 --- a/src/Security/Authentication/Cookies/src/CookieAuthenticationEvents.cs +++ b/src/Security/Authentication/Cookies/src/CookieAuthenticationEvents.cs @@ -9,7 +9,7 @@ using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Authentication.Cookies { /// - /// This default implementation of the ICookieAuthenticationEvents may be used if the + /// This default implementation of the ICookieAuthenticationEvents may be used if the /// application only needs to override a few of the interface methods. This may be used as a base class /// or may be instantiated directly. /// @@ -103,9 +103,9 @@ namespace Microsoft.AspNetCore.Authentication.Cookies private static bool IsAjaxRequest(HttpRequest request) { - return string.Equals(request.Query["X-Requested-With"], "XMLHttpRequest", StringComparison.Ordinal) || - string.Equals(request.Headers["X-Requested-With"], "XMLHttpRequest", StringComparison.Ordinal); - } + return string.Equals(request.Query[HeaderNames.XRequestedWith], "XMLHttpRequest", StringComparison.Ordinal) || + string.Equals(request.Headers[HeaderNames.XRequestedWith], "XMLHttpRequest", StringComparison.Ordinal); + } /// /// Implements the interface method by invoking the related delegate method. diff --git a/src/SignalR/clients/csharp/Client/test/UnitTests/HttpConnectionTests.Transport.cs b/src/SignalR/clients/csharp/Client/test/UnitTests/HttpConnectionTests.Transport.cs index 0244af0afd..a15f18faa1 100644 --- a/src/SignalR/clients/csharp/Client/test/UnitTests/HttpConnectionTests.Transport.cs +++ b/src/SignalR/clients/csharp/Client/test/UnitTests/HttpConnectionTests.Transport.cs @@ -15,6 +15,7 @@ using Microsoft.AspNetCore.Http.Connections; using Microsoft.AspNetCore.Http.Connections.Client; using Microsoft.AspNetCore.Http.Connections.Client.Internal; using Microsoft.AspNetCore.SignalR.Tests; +using Microsoft.Net.Http.Headers; using Xunit; namespace Microsoft.AspNetCore.SignalR.Client.Tests @@ -162,7 +163,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests testHttpHandler.OnRequest(async (request, next, token) => { - var requestedWithHeader = request.Headers.GetValues("X-Requested-With"); + var requestedWithHeader = request.Headers.GetValues(HeaderNames.XRequestedWith); var requestedWithValue = Assert.Single(requestedWithHeader); Assert.Equal("XMLHttpRequest", requestedWithValue); diff --git a/src/SignalR/server/SignalR/test/WebSocketsTransportTests.cs b/src/SignalR/server/SignalR/test/WebSocketsTransportTests.cs index 70b985851f..2c059c3edc 100644 --- a/src/SignalR/server/SignalR/test/WebSocketsTransportTests.cs +++ b/src/SignalR/server/SignalR/test/WebSocketsTransportTests.cs @@ -13,6 +13,7 @@ using Microsoft.AspNetCore.Connections; using Microsoft.AspNetCore.Http.Connections.Client; using Microsoft.AspNetCore.Http.Connections.Client.Internal; using Microsoft.AspNetCore.Testing; +using Microsoft.Net.Http.Headers; using Moq; using Xunit; @@ -103,7 +104,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests await webSocketsTransport.StartAsync(new Uri(server.WebSocketsUrl + "/httpheader"), TransferFormat.Binary).OrTimeout(); - await webSocketsTransport.Output.WriteAsync(Encoding.UTF8.GetBytes("X-Requested-With")); + await webSocketsTransport.Output.WriteAsync(Encoding.UTF8.GetBytes(HeaderNames.XRequestedWith)); // The HTTP header endpoint closes the connection immediately after sending response which should stop the transport await webSocketsTransport.Running.OrTimeout(); From cda762685ab4f01f92615877f64dca08fe1eef32 Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Tue, 3 Mar 2020 20:42:46 -0800 Subject: [PATCH 40/50] Allow cert file and private key file to be passed in (#19477) --- .../src/Internal/QuicConnectionListener.cs | 10 +++++++++- .../Kestrel/Transport.Quic/src/QuicTransportOptions.cs | 10 ++++++++++ .../Quic/Implementations/MsQuic/Internal/MsQuicApi.cs | 6 +++--- src/Shared/runtime/Quic/Interop/MsQuicNativeMethods.cs | 4 ++-- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/Servers/Kestrel/Transport.Quic/src/Internal/QuicConnectionListener.cs b/src/Servers/Kestrel/Transport.Quic/src/Internal/QuicConnectionListener.cs index 1b36d90ab0..12af5859f6 100644 --- a/src/Servers/Kestrel/Transport.Quic/src/Internal/QuicConnectionListener.cs +++ b/src/Servers/Kestrel/Transport.Quic/src/Internal/QuicConnectionListener.cs @@ -29,10 +29,18 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Internal _log = log; _context = new QuicTransportContext(_log, options); EndPoint = endpoint; + + var quicListenerOptions = new QuicListenerOptions(); var sslConfig = new SslServerAuthenticationOptions(); sslConfig.ServerCertificate = options.Certificate; sslConfig.ApplicationProtocols = new List() { new SslApplicationProtocol(options.Alpn) }; - _listener = new QuicListener(QuicImplementationProviders.MsQuic, endpoint as IPEndPoint, sslConfig); + + quicListenerOptions.ServerAuthenticationOptions = sslConfig; + quicListenerOptions.CertificateFilePath = options.CertificateFilePath; + quicListenerOptions.PrivateKeyFilePath = options.PrivateKeyFilePath; + quicListenerOptions.ListenEndPoint = endpoint as IPEndPoint; + + _listener = new QuicListener(QuicImplementationProviders.MsQuic, quicListenerOptions); _listener.Start(); } diff --git a/src/Servers/Kestrel/Transport.Quic/src/QuicTransportOptions.cs b/src/Servers/Kestrel/Transport.Quic/src/QuicTransportOptions.cs index 985222d3d1..8ed5fe3dd8 100644 --- a/src/Servers/Kestrel/Transport.Quic/src/QuicTransportOptions.cs +++ b/src/Servers/Kestrel/Transport.Quic/src/QuicTransportOptions.cs @@ -29,6 +29,16 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Quic /// public X509Certificate2 Certificate { get; set; } + /// + /// Optional path to certificate file to configure the security configuration. + /// + public string CertificateFilePath { get; set; } + + /// + /// Optional path to private key file to configure the security configuration. + /// + public string PrivateKeyFilePath { get; set; } + /// /// Sets the idle timeout for connections and streams. /// diff --git a/src/Shared/runtime/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs b/src/Shared/runtime/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs index fb6330c024..977af1da93 100644 --- a/src/Shared/runtime/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs +++ b/src/Shared/runtime/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs @@ -236,8 +236,8 @@ namespace System.Net.Quic.Implementations.MsQuic.Internal { fileParams = new MsQuicNativeMethods.CertFileParams { - CertificateFilePath = Marshal.StringToCoTaskMemUTF8(certFilePath), - PrivateKeyFilePath = Marshal.StringToCoTaskMemUTF8(privateKeyFilePath) + PrivateKeyFilePath = Marshal.StringToCoTaskMemUTF8(privateKeyFilePath), + CertificateFilePath = Marshal.StringToCoTaskMemUTF8(certFilePath) }; unmanagedAddr = Marshal.AllocHGlobal(Marshal.SizeOf(fileParams)); @@ -246,7 +246,7 @@ namespace System.Net.Quic.Implementations.MsQuic.Internal createConfigStatus = SecConfigCreateDelegate( _registrationContext, (uint)QUIC_SEC_CONFIG_FLAG.CERT_FILE, - certificate.Handle, + unmanagedAddr, null, IntPtr.Zero, SecCfgCreateCallbackHandler); diff --git a/src/Shared/runtime/Quic/Interop/MsQuicNativeMethods.cs b/src/Shared/runtime/Quic/Interop/MsQuicNativeMethods.cs index aca6b41a58..6f7edba173 100644 --- a/src/Shared/runtime/Quic/Interop/MsQuicNativeMethods.cs +++ b/src/Shared/runtime/Quic/Interop/MsQuicNativeMethods.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -481,8 +481,8 @@ namespace System.Net.Quic.Implementations.MsQuic.Internal [StructLayout(LayoutKind.Sequential)] internal struct CertFileParams { - internal IntPtr CertificateFilePath; internal IntPtr PrivateKeyFilePath; + internal IntPtr CertificateFilePath; } } } From 56fb4b4d2f2be4156d30158bab4afdb71ecfbdf7 Mon Sep 17 00:00:00 2001 From: Brennan Date: Wed, 4 Mar 2020 08:10:18 -0800 Subject: [PATCH 41/50] Rename Flaky attribute (#19469) --- .azure/pipelines/ci.yml | 24 ++--- Directory.Build.props | 4 +- eng/FlakyTests.AfterArcade.props | 7 -- eng/FlakyTests.BeforeArcade.props | 18 ---- eng/QuarantinedTests.AfterArcade.props | 7 ++ eng/QuarantinedTests.BeforeArcade.props | 11 +++ eng/helix/content/runtests.cmd | 10 +- eng/helix/content/runtests.sh | 6 +- .../test/E2ETest/Tests/EventTest.cs | 2 +- .../Identity.Test/IdentityUIScriptsTest.cs | 2 +- ...TempDataInCookiesUsingCookieConsentTest.cs | 4 +- .../Listener/RequestBodyTests.cs | 4 +- .../FunctionalTests/ResponseCachingTests.cs | 8 +- .../test/FunctionalTests/ServerTests.cs | 2 +- .../Common.FunctionalTests/AppOfflineTests.cs | 2 +- .../ConfigurationChangeTests.cs | 2 +- .../Inprocess/FrebTests.cs | 2 +- .../Inprocess/SynchronousReadAndWriteTests.cs | 2 +- .../Common.FunctionalTests/LogFileTests.cs | 2 +- .../test/IIS.Tests/ClientDisconnectTests.cs | 2 +- .../BindTests/AddressRegistrationTests.cs | 10 +- .../MaxRequestBufferSizeTests.cs | 2 +- .../FunctionalTests/UnixDomainSocketsTests.cs | 2 +- .../ConnectionLimitTests.cs | 2 +- .../Http2/Http2TimeoutTests.cs | 4 +- .../Http3/Http3StreamTests.cs | 2 +- .../Interop.FunctionalTests/H2SpecTests.cs | 2 +- .../HttpClientHttp2InteropTests.cs | 4 +- src/Testing/src/FlakyOn.cs | 41 -------- src/Testing/src/xunit/FlakyAttribute.cs | 92 ----------------- src/Testing/src/xunit/FlakyTraitDiscoverer.cs | 38 ------- .../src/xunit/QuarantinedTestAttribute.cs | 57 +++++++++++ .../xunit/QuarantinedTestTraitDiscoverer.cs | 26 +++++ src/Testing/test/FlakyAttributeTest.cs | 99 ------------------- .../test/QuarantinedTestAttributeTest.cs | 22 +++++ .../test/OpenApiAddURLTests.cs | 26 ++--- .../test/InitCommandTest.cs | 1 + .../test/SecretManagerTests.cs | 20 ++-- .../dotnet-watch/test/AppWithDepsTests.cs | 2 +- .../dotnet-watch/test/DotNetWatcherTests.cs | 4 +- .../dotnet-watch/test/GlobbingAppTests.cs | 10 +- src/Tools/dotnet-watch/test/NoDepsAppTests.cs | 4 +- 42 files changed, 209 insertions(+), 382 deletions(-) delete mode 100644 eng/FlakyTests.AfterArcade.props delete mode 100644 eng/FlakyTests.BeforeArcade.props create mode 100644 eng/QuarantinedTests.AfterArcade.props create mode 100644 eng/QuarantinedTests.BeforeArcade.props delete mode 100644 src/Testing/src/FlakyOn.cs delete mode 100644 src/Testing/src/xunit/FlakyAttribute.cs delete mode 100644 src/Testing/src/xunit/FlakyTraitDiscoverer.cs create mode 100644 src/Testing/src/xunit/QuarantinedTestAttribute.cs create mode 100644 src/Testing/src/xunit/QuarantinedTestTraitDiscoverer.cs delete mode 100644 src/Testing/test/FlakyAttributeTest.cs create mode 100644 src/Testing/test/QuarantinedTestAttributeTest.cs diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 82cb6cb5bc..eb38671015 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -499,15 +499,15 @@ stages: - powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1" displayName: Setup IISExpress test certificates and schema afterBuild: - - powershell: "& ./build.ps1 -CI -NoBuild -Test /p:RunFlakyTests=true" - displayName: Run Flaky Tests + - powershell: "& ./build.ps1 -CI -NoBuild -Test /p:RunQuarantinedTests=true" + displayName: Run Quarantined Tests continueOnError: true - task: PublishTestResults@2 - displayName: Publish Flaky Test Results + displayName: Publish Quarantined Test Results inputs: testResultsFormat: 'xUnit' testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Flaky' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Quarantined' artifacts: - name: Windows_Test_Dumps path: artifacts/dumps/ @@ -574,15 +574,15 @@ stages: displayName: Pack Packages (for Template tests) - bash: ./src/ProjectTemplates/build.sh --ci --pack --no-restore --no-build-deps "/bl:artifacts/log/template.pack.binlog" displayName: Pack Templates (for Template tests) - - bash: ./build.sh --no-build --ci --test -p:RunFlakyTests=true - displayName: Run Flaky Tests + - bash: ./build.sh --no-build --ci --test -p:RunQuarantinedTests=true + displayName: Run Quarantined Tests continueOnError: true - task: PublishTestResults@2 - displayName: Publish Flaky Test Results + displayName: Publish Quarantined Test Results inputs: testResultsFormat: 'xUnit' testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Flaky' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Quarantined' artifacts: - name: MacOS_Test_Logs path: artifacts/log/ @@ -611,15 +611,15 @@ stages: displayName: Pack Packages (for Template tests) - bash: ./src/ProjectTemplates/build.sh --ci --pack --no-restore --no-build-deps "/bl:artifacts/log/template.pack.binlog" displayName: Pack Templates (for Template tests) - - bash: ./build.sh --no-build --ci --test -p:RunFlakyTests=true - displayName: Run Flaky Tests + - bash: ./build.sh --no-build --ci --test -p:RunQuarantinedTests=true + displayName: Run Quarantined Tests continueOnError: true - task: PublishTestResults@2 - displayName: Publish Flaky Test Results + displayName: Publish Quarantined Test Results inputs: testResultsFormat: 'xUnit' testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Flaky' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Quarantined' artifacts: - name: Linux_Test_Logs path: artifacts/log/ diff --git a/Directory.Build.props b/Directory.Build.props index 3ef4008890..a2765ff560 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -35,9 +35,9 @@ true - + - + Microsoft ASP.NET Core diff --git a/eng/FlakyTests.AfterArcade.props b/eng/FlakyTests.AfterArcade.props deleted file mode 100644 index 12f631127e..0000000000 --- a/eng/FlakyTests.AfterArcade.props +++ /dev/null @@ -1,7 +0,0 @@ - - - - $(ArtifactsDir)log\$(Configuration)\Flaky\ - $(ArtifactsDir)TestResults\$(Configuration)\Flaky\ - - diff --git a/eng/FlakyTests.BeforeArcade.props b/eng/FlakyTests.BeforeArcade.props deleted file mode 100644 index 02f9fb6c59..0000000000 --- a/eng/FlakyTests.BeforeArcade.props +++ /dev/null @@ -1,18 +0,0 @@ - - - - <_FlakyRunAdditionalArgs>-trait "Flaky:All=true" - <_NonFlakyRunAdditionalArgs>-notrait "Flaky:All=true" - - - - - <_FlakyRunAdditionalArgs>$(_FlakyRunAdditionalArgs) -trait "Flaky:AzP:All=true" -trait "Flaky:AzP:OS:$(AGENT_OS)=true" - <_NonFlakyRunAdditionalArgs>$(_NonFlakyRunAdditionalArgs) -notrait "Flaky:AzP:All=true" -notrait "Flaky:AzP:OS:$(AGENT_OS)=true" - - - - $(_NonFlakyRunAdditionalArgs) $(TestRunnerAdditionalArguments) - $(_FlakyRunAdditionalArgs) $(TestRunnerAdditionalArguments) - - diff --git a/eng/QuarantinedTests.AfterArcade.props b/eng/QuarantinedTests.AfterArcade.props new file mode 100644 index 0000000000..4e0b5cde30 --- /dev/null +++ b/eng/QuarantinedTests.AfterArcade.props @@ -0,0 +1,7 @@ + + + + $(ArtifactsDir)log\$(Configuration)\Quarantined\ + $(ArtifactsDir)TestResults\$(Configuration)\Quarantined\ + + diff --git a/eng/QuarantinedTests.BeforeArcade.props b/eng/QuarantinedTests.BeforeArcade.props new file mode 100644 index 0000000000..5fa5fdcaf6 --- /dev/null +++ b/eng/QuarantinedTests.BeforeArcade.props @@ -0,0 +1,11 @@ + + + <_QuarantinedTestRunAdditionalArgs>-trait "Quarantined=true" + <_NonQuarantinedTestRunAdditionalArgs>-notrait "Quarantined=true" + + + + $(_NonQuarantinedTestRunAdditionalArgs) $(TestRunnerAdditionalArguments) + $(_QuarantinedTestRunAdditionalArgs) $(TestRunnerAdditionalArguments) + + diff --git a/eng/helix/content/runtests.cmd b/eng/helix/content/runtests.cmd index 73cf658c18..5fe1af7eb6 100644 --- a/eng/helix/content/runtests.cmd +++ b/eng/helix/content/runtests.cmd @@ -53,23 +53,21 @@ if %$quarantined%==True ( set %$quarantined=true ) -set NONQUARANTINE_FILTER="Flaky:All!=true&Flaky:Helix:All!=true&Flaky:Helix:Queue:All!=true&Flaky:Helix:Queue:%HELIX%!=true" -set QUARANTINE_FILTER="Flaky:All=true|Flaky:Helix:All=true|Flaky:Helix:Queue:All=true|Flaky:Helix:Queue:%HELIX%=true" +set NONQUARANTINE_FILTER="Quarantined!=true" +set QUARANTINE_FILTER="Quarantined=true" if %$quarantined%==true ( echo Running quarantined tests. %DOTNET_ROOT%\dotnet vstest %$target% --logger:xunit --TestCaseFilter:%QUARANTINE_FILTER% if errorlevel 1 ( - echo Failure in flaky test 1>&2 + echo Failure in quarantined test 1>&2 REM DO NOT EXIT and DO NOT SET EXIT_CODE to 1 ) ) else ( - REM We need to specify all possible Flaky filters that apply to this environment, because the flaky attribute - REM only puts the explicit filter traits the user provided in REM Filter syntax: https://github.com/Microsoft/vstest-docs/blob/master/docs/filter.md echo Running non-quarantined tests. %DOTNET_ROOT%\dotnet vstest %$target% --logger:xunit --TestCaseFilter:%NONQUARANTINE_FILTER% if errorlevel 1 ( - echo Failure in non-flaky test 1>&2 + echo Failure in non-quarantined test 1>&2 set exit_code=1 REM DO NOT EXIT ) diff --git a/eng/helix/content/runtests.sh b/eng/helix/content/runtests.sh index c31297d587..7d319e0a38 100644 --- a/eng/helix/content/runtests.sh +++ b/eng/helix/content/runtests.sh @@ -115,11 +115,9 @@ fi exit_code=0 -# We need to specify all possible quarantined filters that apply to this environment, because the quarantine attribute -# only puts the explicit filter traits the user provided in the flaky attribute # Filter syntax: https://github.com/Microsoft/vstest-docs/blob/master/docs/filter.md -NONQUARANTINE_FILTER="Flaky:All!=true&Flaky:Helix:All!=true&Flaky:Helix:Queue:All!=true&Flaky:Helix:Queue:$helix_queue_name!=true" -QUARANTINE_FILTER="Flaky:All=true|Flaky:Helix:All=true|Flaky:Helix:Queue:All=true|Flaky:Helix:Queue:$helix_queue_name=true" +NONQUARANTINE_FILTER="Quarantined!=true" +QUARANTINE_FILTER="Quarantined=true" if [ "$quarantined" == true ]; then echo "Running all tests including quarantined." $DOTNET_ROOT/dotnet vstest $test_binary_path --logger:xunit --TestCaseFilter:"$QUARANTINE_FILTER" diff --git a/src/Components/test/E2ETest/Tests/EventTest.cs b/src/Components/test/E2ETest/Tests/EventTest.cs index 06dbbb969f..d2fd55b195 100644 --- a/src/Components/test/E2ETest/Tests/EventTest.cs +++ b/src/Components/test/E2ETest/Tests/EventTest.cs @@ -167,7 +167,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Tests } [Fact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/1987", FlakyOn.AzP.Windows)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/1987")] public void InputEvent_RespondsOnKeystrokes() { Browser.MountTestComponent(); diff --git a/src/Identity/test/Identity.Test/IdentityUIScriptsTest.cs b/src/Identity/test/Identity.Test/IdentityUIScriptsTest.cs index 96157ed4ea..005895f9c0 100644 --- a/src/Identity/test/Identity.Test/IdentityUIScriptsTest.cs +++ b/src/Identity/test/Identity.Test/IdentityUIScriptsTest.cs @@ -79,7 +79,7 @@ namespace Microsoft.AspNetCore.Identity.Test [Theory] [MemberData(nameof(ScriptWithFallbackSrcData))] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2267", FlakyOn.AzP.macOS)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2267")] public async Task IdentityUI_ScriptTags_FallbackSourceContent_Matches_CDNContent(ScriptTag scriptTag) { var wwwrootDir = Path.Combine(GetProjectBasePath(), "wwwroot", scriptTag.Version); diff --git a/src/Mvc/test/Mvc.FunctionalTests/TempDataInCookiesUsingCookieConsentTest.cs b/src/Mvc/test/Mvc.FunctionalTests/TempDataInCookiesUsingCookieConsentTest.cs index 14a4681180..546f862e21 100644 --- a/src/Mvc/test/Mvc.FunctionalTests/TempDataInCookiesUsingCookieConsentTest.cs +++ b/src/Mvc/test/Mvc.FunctionalTests/TempDataInCookiesUsingCookieConsentTest.cs @@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests builder.UseStartup(); [Fact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/1803", FlakyOn.AzP.Windows)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/1803")] public async Task CookieTempDataProviderCookie_SetInResponse_OnGrantingConsent() { // Arrange @@ -64,7 +64,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests } [Fact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/1803", FlakyOn.AzP.Windows)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/1803")] public async Task CookieTempDataProviderCookie_NotSetInResponse_OnNoConsent() { // Arrange diff --git a/src/Servers/HttpSys/test/FunctionalTests/Listener/RequestBodyTests.cs b/src/Servers/HttpSys/test/FunctionalTests/Listener/RequestBodyTests.cs index 2f0308af9b..8e2860cf69 100644 --- a/src/Servers/HttpSys/test/FunctionalTests/Listener/RequestBodyTests.cs +++ b/src/Servers/HttpSys/test/FunctionalTests/Listener/RequestBodyTests.cs @@ -17,7 +17,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener public class RequestBodyTests { [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/1826", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/1826")] public async Task RequestBody_SyncReadDisabledByDefault_WorksWhenEnabled() { string address; @@ -142,7 +142,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener } [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2206", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2206")] public async Task RequestBody_ReadAsyncPartialBodyAndExpiredTimeout_Canceled() { StaggardContent content = new StaggardContent(); diff --git a/src/Servers/HttpSys/test/FunctionalTests/ResponseCachingTests.cs b/src/Servers/HttpSys/test/FunctionalTests/ResponseCachingTests.cs index 2c45b352e3..1112420ed6 100644 --- a/src/Servers/HttpSys/test/FunctionalTests/ResponseCachingTests.cs +++ b/src/Servers/HttpSys/test/FunctionalTests/ResponseCachingTests.cs @@ -45,7 +45,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.FunctionalTests } [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2135", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2135")] public async Task Caching_JustPublic_NotCached() { var requestCount = 1; @@ -86,7 +86,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.FunctionalTests } [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2207", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2207")] public async Task Caching_WithoutContentType_Cached_OnWin7AndWin2008R2() { if (Utilities.IsWin8orLater) @@ -237,7 +237,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.FunctionalTests [ConditionalTheory] [InlineData("0")] [InlineData("-1")] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2208", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2208")] public async Task Caching_InvalidExpires_NotCached(string expiresValue) { var requestCount = 1; @@ -378,7 +378,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.FunctionalTests } [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2209", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2209")] public async Task Caching_VariousStatusCodes_Cached() { var requestCount = 1; diff --git a/src/Servers/HttpSys/test/FunctionalTests/ServerTests.cs b/src/Servers/HttpSys/test/FunctionalTests/ServerTests.cs index bf266025b4..fbea889de4 100644 --- a/src/Servers/HttpSys/test/FunctionalTests/ServerTests.cs +++ b/src/Servers/HttpSys/test/FunctionalTests/ServerTests.cs @@ -131,7 +131,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys } [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2267", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2267")] public async Task Server_ShutdownDuringRequest_Success() { Task responseTask; diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/AppOfflineTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/AppOfflineTests.cs index 13409c545d..89c44e719f 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/AppOfflineTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/AppOfflineTests.cs @@ -211,7 +211,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests [ConditionalTheory] [InlineData(HostingModel.InProcess)] [InlineData(HostingModel.OutOfProcess)] - [Flaky("https://github.com/dotnet/aspnetcore/issues/7075", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/7075")] public async Task AppOfflineAddedAndRemovedStress(HostingModel hostingModel) { var deploymentResult = await AssertStarts(hostingModel); diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/ConfigurationChangeTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/ConfigurationChangeTests.cs index 92f581b156..66ffde7f20 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/ConfigurationChangeTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/ConfigurationChangeTests.cs @@ -79,7 +79,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests [ConditionalTheory] [InlineData(HostingModel.InProcess)] [InlineData(HostingModel.OutOfProcess)] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/1794", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/1794")] public async Task ConfigurationTouchedStress(HostingModel hostingModel) { var deploymentResult = await DeployAsync(Fixture.GetBaseDeploymentParameters(hostingModel)); diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/FrebTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/FrebTests.cs index 68c1762048..7573fc021d 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/FrebTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/FrebTests.cs @@ -80,7 +80,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess // I think this test is flaky due to freb file not being created quickly enough. // Adding extra logging, marking as flaky, and repeating should help [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2570", FlakyOn.Helix.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2570")] [Repeat(10)] [RequiresIIS(IISCapability.FailedRequestTracingModule)] public async Task CheckFrebDisconnect() diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/SynchronousReadAndWriteTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/SynchronousReadAndWriteTests.cs index 72fcdeefd5..e896acc67c 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/SynchronousReadAndWriteTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/SynchronousReadAndWriteTests.cs @@ -22,7 +22,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess } [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore/issues/7341", FlakyOn.Helix.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/7341")] public async Task ReadAndWriteSynchronously() { for (int i = 0; i < 100; i++) diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/LogFileTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/LogFileTests.cs index 6a15e6f4b3..0a60187315 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/LogFileTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/LogFileTests.cs @@ -171,7 +171,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests [ConditionalTheory] [MemberData(nameof(TestVariants))] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2200", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2200")] public async Task CheckUTF8File(TestVariant variant) { var path = "CheckConsoleFunctions"; diff --git a/src/Servers/IIS/IIS/test/IIS.Tests/ClientDisconnectTests.cs b/src/Servers/IIS/IIS/test/IIS.Tests/ClientDisconnectTests.cs index 5fe5d75a87..354b8a2229 100644 --- a/src/Servers/IIS/IIS/test/IIS.Tests/ClientDisconnectTests.cs +++ b/src/Servers/IIS/IIS/test/IIS.Tests/ClientDisconnectTests.cs @@ -225,7 +225,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests } [ConditionalFact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/1817", FlakyOn.AzP.Windows)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/1817")] public async Task ReaderThrowsResetExceptionOnInvalidBody() { var requestStartedCompletionSource = CreateTaskCompletionSource(); diff --git a/src/Servers/Kestrel/test/BindTests/AddressRegistrationTests.cs b/src/Servers/Kestrel/test/BindTests/AddressRegistrationTests.cs index de4189a207..787d3fe7c8 100644 --- a/src/Servers/Kestrel/test/BindTests/AddressRegistrationTests.cs +++ b/src/Servers/Kestrel/test/BindTests/AddressRegistrationTests.cs @@ -100,7 +100,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests [ConditionalTheory] [MemberData(nameof(IPEndPointRegistrationDataDynamicPort))] [IPv6SupportedCondition] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2074", FlakyOn.AzP.macOS)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2074")] public async Task RegisterIPEndPoint_DynamicPort_Success(IPEndPoint endPoint, string testUrl) { await RegisterIPEndPoint_Success(endPoint, testUrl); @@ -109,7 +109,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests [ConditionalTheory] [MemberData(nameof(IPEndPointRegistrationDataPort443))] [IPv6SupportedCondition] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2711", FlakyOn.AzP.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2711")] public async Task RegisterIPEndPoint_Port443_Success(IPEndPoint endpoint, string testUrl) { if (!CanBindToEndpoint(endpoint.Address, 443)) @@ -131,7 +131,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests [ConditionalTheory] [MemberData(nameof(AddressRegistrationDataIPv6Port5000Default))] [IPv6SupportedCondition] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2711", FlakyOn.AzP.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2711")] public async Task RegisterAddresses_IPv6Port5000Default_Success(string addressInput, string[] testUrls) { if (!CanBindToEndpoint(IPAddress.Loopback, 5000) || !CanBindToEndpoint(IPAddress.IPv6Loopback, 5000)) @@ -145,7 +145,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests [ConditionalTheory] [MemberData(nameof(AddressRegistrationDataIPv6Port80))] [IPv6SupportedCondition] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2711", FlakyOn.AzP.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2711")] public async Task RegisterAddresses_IPv6Port80_Success(string addressInput, string[] testUrls) { if (!CanBindToEndpoint(IPAddress.Loopback, 80) || !CanBindToEndpoint(IPAddress.IPv6Loopback, 80)) @@ -157,7 +157,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests } [ConditionalTheory] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2179", FlakyOn.Helix.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2179")] [MemberData(nameof(AddressRegistrationDataIPv6ScopeId))] [IPv6SupportedCondition] [IPv6ScopeIdPresentCondition] diff --git a/src/Servers/Kestrel/test/FunctionalTests/MaxRequestBufferSizeTests.cs b/src/Servers/Kestrel/test/FunctionalTests/MaxRequestBufferSizeTests.cs index b3c17c8ea3..59c3b9ce4c 100644 --- a/src/Servers/Kestrel/test/FunctionalTests/MaxRequestBufferSizeTests.cs +++ b/src/Servers/Kestrel/test/FunctionalTests/MaxRequestBufferSizeTests.cs @@ -108,7 +108,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests } } [Theory] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2489", FlakyOn.AzP.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2489")] [MemberData(nameof(LargeUploadData))] public async Task LargeUpload(long? maxRequestBufferSize, bool connectionAdapter, bool expectPause) { diff --git a/src/Servers/Kestrel/test/FunctionalTests/UnixDomainSocketsTests.cs b/src/Servers/Kestrel/test/FunctionalTests/UnixDomainSocketsTests.cs index cca069aeae..dc247c6543 100644 --- a/src/Servers/Kestrel/test/FunctionalTests/UnixDomainSocketsTests.cs +++ b/src/Servers/Kestrel/test/FunctionalTests/UnixDomainSocketsTests.cs @@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests #endif [ConditionalFact] [CollectDump] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task TestUnixDomainSocket() { var path = Path.GetTempFileName(); diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/ConnectionLimitTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/ConnectionLimitTests.cs index 43c92b0121..532629f0dd 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/ConnectionLimitTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/ConnectionLimitTests.cs @@ -142,7 +142,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests } [Fact] - [Flaky("https://github.com/aspnet/KestrelHttpServer/issues/2282", FlakyOn.AzP.macOS)] + [QuarantinedTest("https://github.com/aspnet/KestrelHttpServer/issues/2282")] public async Task ConnectionCountingReturnsToZero() { const int count = 100; diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TimeoutTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TimeoutTests.cs index 1d18ac20c0..5ae038fed1 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TimeoutTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TimeoutTests.cs @@ -263,7 +263,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests } [Fact] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/1323", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/1323")] public async Task DATA_Sent_TooSlowlyDueToSocketBackPressureOnSmallWrite_AbortsConnectionAfterGracePeriod() { var mockSystemClock = _serviceContext.MockSystemClock; @@ -316,7 +316,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task DATA_Sent_TooSlowlyDueToSocketBackPressureOnLargeWrite_AbortsConnectionAfterRateTimeout() { var mockSystemClock = _serviceContext.MockSystemClock; diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3StreamTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3StreamTests.cs index ac206bcaa4..a0445ab86f 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3StreamTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http3/Http3StreamTests.cs @@ -264,7 +264,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task MissingAuthority_200Status() { var headers = new[] diff --git a/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs b/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs index d7b2066a3f..862adb0bb4 100644 --- a/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs +++ b/src/Servers/Kestrel/test/Interop.FunctionalTests/H2SpecTests.cs @@ -21,7 +21,7 @@ namespace Interop.FunctionalTests { [ConditionalTheory] [MemberData(nameof(H2SpecTestCases))] - [Flaky("https://github.com/dotnet/aspnetcore-internal/issues/2225", FlakyOn.Helix.All)] + [QuarantinedTest("https://github.com/dotnet/aspnetcore-internal/issues/2225")] public async Task RunIndividualTestCase(H2SpecTestCase testCase) { var hostBuilder = new WebHostBuilder() diff --git a/src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs b/src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs index 59c212d2ed..a3ac8e7656 100644 --- a/src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs +++ b/src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs @@ -1024,7 +1024,7 @@ namespace Interop.FunctionalTests } [Theory] - [Flaky("https://github.com/dotnet/runtime/issues/860", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/runtime/issues/860")] [MemberData(nameof(SupportedSchemes))] public async Task RequestHeaders_MultipleFrames_Accepted(string scheme) { @@ -1346,7 +1346,7 @@ namespace Interop.FunctionalTests // Settings_MaxFrameSize_Larger_Client - Not configurable [Theory] - [Flaky("https://github.com/dotnet/runtime/issues/860", FlakyOn.All)] + [QuarantinedTest("https://github.com/dotnet/runtime/issues/860")] [MemberData(nameof(SupportedSchemes))] public async Task Settings_MaxHeaderListSize_Server(string scheme) { diff --git a/src/Testing/src/FlakyOn.cs b/src/Testing/src/FlakyOn.cs deleted file mode 100644 index 81d9299043..0000000000 --- a/src/Testing/src/FlakyOn.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Microsoft.AspNetCore.Testing -{ - public static class FlakyOn - { - public const string All = "All"; - - public static class Helix - { - public const string All = QueuePrefix + "All"; - - public const string Fedora28Amd64 = QueuePrefix + HelixQueues.Fedora28Amd64; - public const string Fedora27Amd64 = QueuePrefix + HelixQueues.Fedora27Amd64; - public const string Redhat7Amd64 = QueuePrefix + HelixQueues.Redhat7Amd64; - public const string Debian9Amd64 = QueuePrefix + HelixQueues.Debian9Amd64; - public const string Debian8Amd64 = QueuePrefix + HelixQueues.Debian8Amd64; - public const string Centos7Amd64 = QueuePrefix + HelixQueues.Centos7Amd64; - public const string Ubuntu1604Amd64 = QueuePrefix + HelixQueues.Ubuntu1604Amd64; - public const string Ubuntu1810Amd64 = QueuePrefix + HelixQueues.Ubuntu1810Amd64; - public const string macOS1012Amd64 = QueuePrefix + HelixQueues.macOS1012Amd64; - public const string Windows10Amd64 = QueuePrefix + HelixQueues.Windows10Amd64; - - private const string Prefix = "Helix:"; - private const string QueuePrefix = Prefix + "Queue:"; - } - - public static class AzP - { - public const string All = Prefix + "All"; - public const string Windows = OsPrefix + "Windows_NT"; - public const string macOS = OsPrefix + "Darwin"; - public const string Linux = OsPrefix + "Linux"; - - private const string Prefix = "AzP:"; - private const string OsPrefix = Prefix + "OS:"; - } - } -} diff --git a/src/Testing/src/xunit/FlakyAttribute.cs b/src/Testing/src/xunit/FlakyAttribute.cs deleted file mode 100644 index f77c56dfc0..0000000000 --- a/src/Testing/src/xunit/FlakyAttribute.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using System.Collections.Generic; -using Xunit.Sdk; - -namespace Microsoft.AspNetCore.Testing -{ - /// - /// Marks a test as "Flaky" so that the build will sequester it and ignore failures. - /// - /// - /// - /// This attribute works by applying xUnit.net "Traits" based on the criteria specified in the attribute - /// properties. Once these traits are applied, build scripts can include/exclude tests based on them. - /// - /// - /// All flakiness-related traits start with Flaky: and are grouped first by the process running the tests: Azure Pipelines (AzP) or Helix. - /// Then there is a segment specifying the "selector" which indicates where the test is flaky. Finally a segment specifying the value of that selector. - /// The value of these traits is always either "true" or the trait is not present. We encode the entire selector in the name of the trait because xUnit.net only - /// provides "==" and "!=" operators for traits, there is no way to check if a trait "contains" or "does not contain" a value. VSTest does support "contains" checks - /// but does not appear to support "does not contain" checks. Using this pattern means we can use simple "==" and "!=" checks to either only run flaky tests, or exclude - /// flaky tests. - /// - /// - /// - /// - /// [Fact] - /// [Flaky("...", HelixQueues.Fedora28Amd64, AzurePipelines.macOS)] - /// public void FlakyTest() - /// { - /// // Flakiness - /// } - /// - /// - /// - /// The above example generates the following facets: - /// - /// - /// - /// - /// Flaky:Helix:Queue:Fedora.28.Amd64.Open = true - /// - /// - /// Flaky:AzP:OS:Darwin = true - /// - /// - /// - /// - /// Given the above attribute, the Azure Pipelines macOS run can easily filter this test out by passing -notrait "Flaky:AzP:OS:all=true" -notrait "Flaky:AzP:OS:Darwin=true" - /// to xunit.console.exe. Similarly, it can run only flaky tests using -trait "Flaky:AzP:OS:all=true" -trait "Flaky:AzP:OS:Darwin=true" - /// - /// - [TraitDiscoverer("Microsoft.AspNetCore.Testing." + nameof(FlakyTraitDiscoverer), "Microsoft.AspNetCore.Testing")] - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)] - public sealed class FlakyAttribute : Attribute, ITraitAttribute - { - /// - /// Gets a URL to a GitHub issue tracking this flaky test. - /// - public string GitHubIssueUrl { get; } - - public IReadOnlyList Filters { get; } - - /// - /// Initializes a new instance of the class with the specified and a list of . If no - /// filters are provided, the test is considered flaky in all environments. - /// - /// - /// At least one filter is required. - /// - /// The URL to a GitHub issue tracking this flaky test. - /// The first filter that indicates where the test is flaky. Use a value from . - /// A list of additional filters that define where this test is flaky. Use values in . - public FlakyAttribute(string gitHubIssueUrl, string firstFilter, params string[] additionalFilters) - { - if (string.IsNullOrEmpty(gitHubIssueUrl)) - { - throw new ArgumentNullException(nameof(gitHubIssueUrl)); - } - - if (string.IsNullOrEmpty(firstFilter)) - { - throw new ArgumentNullException(nameof(firstFilter)); - } - - GitHubIssueUrl = gitHubIssueUrl; - var filters = new List(); - filters.Add(firstFilter); - filters.AddRange(additionalFilters); - Filters = filters; - } - } -} diff --git a/src/Testing/src/xunit/FlakyTraitDiscoverer.cs b/src/Testing/src/xunit/FlakyTraitDiscoverer.cs deleted file mode 100644 index 4e6bc27b1b..0000000000 --- a/src/Testing/src/xunit/FlakyTraitDiscoverer.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using Xunit.Abstractions; -using Xunit.Sdk; - -// Do not change this namespace without changing the usage in FlakyAttribute -namespace Microsoft.AspNetCore.Testing -{ - public class FlakyTraitDiscoverer : ITraitDiscoverer - { - public IEnumerable> GetTraits(IAttributeInfo traitAttribute) - { - if (traitAttribute is ReflectionAttributeInfo attribute && attribute.Attribute is FlakyAttribute flakyAttribute) - { - return GetTraitsCore(flakyAttribute); - } - else - { - throw new InvalidOperationException("The 'Flaky' attribute is only supported via reflection."); - } - } - - private IEnumerable> GetTraitsCore(FlakyAttribute attribute) - { - if (attribute.Filters.Count > 0) - { - foreach (var filter in attribute.Filters) - { - yield return new KeyValuePair($"Flaky:{filter}", "true"); - } - } - else - { - yield return new KeyValuePair($"Flaky:All", "true"); - } - } - } -} diff --git a/src/Testing/src/xunit/QuarantinedTestAttribute.cs b/src/Testing/src/xunit/QuarantinedTestAttribute.cs new file mode 100644 index 0000000000..350dcf1e12 --- /dev/null +++ b/src/Testing/src/xunit/QuarantinedTestAttribute.cs @@ -0,0 +1,57 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using Xunit.Sdk; + +namespace Microsoft.AspNetCore.Testing +{ + /// + /// Marks a test as "Quarantined" so that the build will sequester it and ignore failures. + /// + /// + /// + /// This attribute works by applying xUnit.net "Traits" based on the criteria specified in the attribute + /// properties. Once these traits are applied, build scripts can include/exclude tests based on them. + /// + /// + /// + /// + /// [Fact] + /// [QuarantinedTest] + /// public void FlakyTest() + /// { + /// // Flakiness + /// } + /// + /// + /// + /// The above example generates the following facet: + /// + /// + /// + /// + /// Quarantined = true + /// + /// + /// + [TraitDiscoverer("Microsoft.AspNetCore.Testing." + nameof(QuarantinedTestTraitDiscoverer), "Microsoft.AspNetCore.Testing")] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)] + public sealed class QuarantinedTestAttribute : Attribute, ITraitAttribute + { + /// + /// Gets an optional reason for the quarantining, such as a link to a GitHub issue URL with more details as to why the test is quarantined. + /// + public string Reason { get; } + + /// + /// Initializes a new instance of the class with an optional . + /// + /// A reason that this test is quarantined. + public QuarantinedTestAttribute(string reason = null) + { + Reason = reason; + } + } +} diff --git a/src/Testing/src/xunit/QuarantinedTestTraitDiscoverer.cs b/src/Testing/src/xunit/QuarantinedTestTraitDiscoverer.cs new file mode 100644 index 0000000000..256e2b6cfc --- /dev/null +++ b/src/Testing/src/xunit/QuarantinedTestTraitDiscoverer.cs @@ -0,0 +1,26 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using Xunit.Abstractions; +using Xunit.Sdk; + +// Do not change this namespace without changing the usage in QuarantinedTestAttribute +namespace Microsoft.AspNetCore.Testing +{ + public class QuarantinedTestTraitDiscoverer : ITraitDiscoverer + { + public IEnumerable> GetTraits(IAttributeInfo traitAttribute) + { + if (traitAttribute is ReflectionAttributeInfo attribute && attribute.Attribute is QuarantinedTestAttribute quarantinedTestAttribute) + { + yield return new KeyValuePair("Quarantined", "true"); + } + else + { + throw new InvalidOperationException("The 'QuarantinedTest' attribute is only supported via reflection."); + } + } + } +} diff --git a/src/Testing/test/FlakyAttributeTest.cs b/src/Testing/test/FlakyAttributeTest.cs deleted file mode 100644 index ae06e5cf50..0000000000 --- a/src/Testing/test/FlakyAttributeTest.cs +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using Xunit; - -namespace Microsoft.AspNetCore.Testing.Tests -{ - public class FlakyAttributeTest - { - [Fact(Skip = "These tests are nice when you need them but annoying when on all the time.")] - [Flaky("http://example.com", FlakyOn.All)] - public void AlwaysFlakyInCI() - { - if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX")) || !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AGENT_OS"))) - { - throw new Exception("Flaky!"); - } - } - - [Fact(Skip = "These tests are nice when you need them but annoying when on all the time.")] - [Flaky("http://example.com", FlakyOn.Helix.All)] - public void FlakyInHelixOnly() - { - if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX"))) - { - throw new Exception("Flaky on Helix!"); - } - } - - [Fact(Skip = "These tests are nice when you need them but annoying when on all the time.")] - [Flaky("http://example.com", FlakyOn.Helix.macOS1012Amd64, FlakyOn.Helix.Fedora28Amd64)] - public void FlakyInSpecificHelixQueue() - { - // Today we don't run Extensions tests on Helix, but this test should light up when we do. - var queueName = Environment.GetEnvironmentVariable("HELIX"); - if (!string.IsNullOrEmpty(queueName)) - { - var failingQueues = new HashSet(StringComparer.OrdinalIgnoreCase) { HelixQueues.macOS1012Amd64, HelixQueues.Fedora28Amd64 }; - if (failingQueues.Contains(queueName)) - { - throw new Exception($"Flaky on Helix Queue '{queueName}' !"); - } - } - } - - [Fact(Skip = "These tests are nice when you need them but annoying when on all the time.")] - [Flaky("http://example.com", FlakyOn.AzP.All)] - public void FlakyInAzPOnly() - { - if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AGENT_OS"))) - { - throw new Exception("Flaky on AzP!"); - } - } - - [Fact(Skip = "These tests are nice when you need them but annoying when on all the time.")] - [Flaky("http://example.com", FlakyOn.AzP.Windows)] - public void FlakyInAzPWindowsOnly() - { - if (string.Equals(Environment.GetEnvironmentVariable("AGENT_OS"), "Windows_NT")) - { - throw new Exception("Flaky on AzP Windows!"); - } - } - - [Fact(Skip = "These tests are nice when you need them but annoying when on all the time.")] - [Flaky("http://example.com", FlakyOn.AzP.macOS)] - public void FlakyInAzPmacOSOnly() - { - if (string.Equals(Environment.GetEnvironmentVariable("AGENT_OS"), "Darwin")) - { - throw new Exception("Flaky on AzP macOS!"); - } - } - - [Fact(Skip = "These tests are nice when you need them but annoying when on all the time.")] - [Flaky("http://example.com", FlakyOn.AzP.Linux)] - public void FlakyInAzPLinuxOnly() - { - if (string.Equals(Environment.GetEnvironmentVariable("AGENT_OS"), "Linux")) - { - throw new Exception("Flaky on AzP Linux!"); - } - } - - [Fact(Skip = "These tests are nice when you need them but annoying when on all the time.")] - [Flaky("http://example.com", FlakyOn.AzP.Linux, FlakyOn.AzP.macOS)] - public void FlakyInAzPNonWindowsOnly() - { - var agentOs = Environment.GetEnvironmentVariable("AGENT_OS"); - if (string.Equals(agentOs, "Linux") || string.Equals(agentOs, "Darwin")) - { - throw new Exception("Flaky on AzP non-Windows!"); - } - } - } -} diff --git a/src/Testing/test/QuarantinedTestAttributeTest.cs b/src/Testing/test/QuarantinedTestAttributeTest.cs new file mode 100644 index 0000000000..5fc6c58041 --- /dev/null +++ b/src/Testing/test/QuarantinedTestAttributeTest.cs @@ -0,0 +1,22 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using Xunit; + +namespace Microsoft.AspNetCore.Testing.Tests +{ + public class QuarantinedTestAttributeTest + { + [Fact(Skip = "These tests are nice when you need them but annoying when on all the time.")] + [QuarantinedTest] + public void AlwaysFlakyInCI() + { + if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX")) || !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AGENT_OS"))) + { + throw new Exception("Flaky!"); + } + } + } +} diff --git a/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddURLTests.cs b/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddURLTests.cs index 26c9d3c1a1..0336cfdef2 100644 --- a/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddURLTests.cs +++ b/src/Tools/Microsoft.dotnet-openapi/test/OpenApiAddURLTests.cs @@ -17,7 +17,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests public OpenApiAddURLTests(ITestOutputHelper output) : base(output){ } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenApi_Add_Url_WithContentDisposition() { var project = CreateBasicProject(withOpenApi: false); @@ -50,7 +50,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenAPI_Add_Url_NoContentDisposition() { var project = CreateBasicProject(withOpenApi: false); @@ -84,7 +84,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenAPI_Add_Url_NoExtension_AssumesJson() { var project = CreateBasicProject(withOpenApi: false); @@ -118,7 +118,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenApi_Add_Url_NoSegment() { var project = CreateBasicProject(withOpenApi: false); @@ -152,7 +152,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenApi_Add_Url() { var project = CreateBasicProject(withOpenApi: false); @@ -185,7 +185,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenApi_Add_Url_SameName_UniqueFile() { var project = CreateBasicProject(withOpenApi: false); @@ -246,7 +246,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenApi_Add_Url_NSwagCSharp() { var project = CreateBasicProject(withOpenApi: false); @@ -279,7 +279,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenApi_Add_Url_NSwagTypeScript() { var project = CreateBasicProject(withOpenApi: false); @@ -312,7 +312,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenApi_Add_Url_OutputFile() { var project = CreateBasicProject(withOpenApi: false); @@ -345,7 +345,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenApi_Add_URL_FileAlreadyExists_Fail() { var project = CreateBasicProject(withOpenApi: false); @@ -404,7 +404,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public void OpenApi_Add_URL_MultipleTimes_OnlyOneReference() { var project = CreateBasicProject(withOpenApi: false); @@ -431,7 +431,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task OpenAPi_Add_URL_InvalidUrl() { var project = CreateBasicProject(withOpenApi: false); @@ -459,7 +459,7 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests Assert.False(File.Exists(jsonFile)); } - [Flaky("", FlakyOn.All)] + [QuarantinedTest] [Fact] public void OpenApi_Add_URL_ActualResponse() { diff --git a/src/Tools/dotnet-user-secrets/test/InitCommandTest.cs b/src/Tools/dotnet-user-secrets/test/InitCommandTest.cs index 3ba82db5d5..d299c208ca 100644 --- a/src/Tools/dotnet-user-secrets/test/InitCommandTest.cs +++ b/src/Tools/dotnet-user-secrets/test/InitCommandTest.cs @@ -57,6 +57,7 @@ namespace Microsoft.Extensions.SecretManager.Tools.Tests } [Fact] + [QuarantinedTest] public void AddsEscapedSpecificSecretIdToProject() { const string SecretId = @"&"; diff --git a/src/Tools/dotnet-user-secrets/test/SecretManagerTests.cs b/src/Tools/dotnet-user-secrets/test/SecretManagerTests.cs index 6d79642a4c..c16a89197f 100644 --- a/src/Tools/dotnet-user-secrets/test/SecretManagerTests.cs +++ b/src/Tools/dotnet-user-secrets/test/SecretManagerTests.cs @@ -37,7 +37,7 @@ namespace Microsoft.Extensions.SecretManager.Tools.Tests [Theory] [InlineData(null)] [InlineData("")] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public void Error_MissingId(string id) { var project = Path.Combine(_fixture.CreateProject(id), "TestProject.csproj"); @@ -83,7 +83,7 @@ namespace Microsoft.Extensions.SecretManager.Tools.Tests [Theory] [InlineData(true)] [InlineData(false)] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public void SetSecrets(bool fromCurrentDirectory) { var secrets = new KeyValuePair[] @@ -149,19 +149,20 @@ namespace Microsoft.Extensions.SecretManager.Tools.Tests } [Fact] + [QuarantinedTest] public void SetSecret_Update_Existing_Secret() { var projectPath = _fixture.GetTempSecretProject(); var secretManager = CreateProgram(); - secretManager.RunInternal("set", "secret1", "value1", "-p", projectPath); + secretManager.RunInternal("set", "secret1", "value1", "-p", projectPath, "--verbose"); Assert.Contains("Successfully saved secret1 = value1 to the secret store.", _console.GetOutput()); - secretManager.RunInternal("set", "secret1", "value2", "-p", projectPath); + secretManager.RunInternal("set", "secret1", "value2", "-p", projectPath, "--verbose"); Assert.Contains("Successfully saved secret1 = value2 to the secret store.", _console.GetOutput()); _console.ClearOutput(); - secretManager.RunInternal("list", "-p", projectPath); + secretManager.RunInternal("list", "-p", projectPath, "--verbose"); Assert.Contains("secret1 = value2", _console.GetOutput()); } @@ -186,7 +187,7 @@ namespace Microsoft.Extensions.SecretManager.Tools.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public void Remove_Non_Existing_Secret() { var projectPath = _fixture.GetTempSecretProject(); @@ -212,7 +213,7 @@ namespace Microsoft.Extensions.SecretManager.Tools.Tests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public void List_Flattens_Nested_Objects() { string secretId; @@ -262,15 +263,16 @@ namespace Microsoft.Extensions.SecretManager.Tools.Tests } [Fact] + [QuarantinedTest] public void List_Empty_Secrets_File() { var projectPath = _fixture.GetTempSecretProject(); var secretManager = CreateProgram(); - secretManager.RunInternal("list", "-p", projectPath); + secretManager.RunInternal("list", "-p", projectPath, "--verbose"); Assert.Contains(Resources.Error_No_Secrets_Found, _console.GetOutput()); } - [Flaky("", FlakyOn.All)] + [QuarantinedTest] [Theory] [InlineData(true)] [InlineData(false)] diff --git a/src/Tools/dotnet-watch/test/AppWithDepsTests.cs b/src/Tools/dotnet-watch/test/AppWithDepsTests.cs index 1ec8a59284..5954f540b5 100644 --- a/src/Tools/dotnet-watch/test/AppWithDepsTests.cs +++ b/src/Tools/dotnet-watch/test/AppWithDepsTests.cs @@ -20,7 +20,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task ChangeFileInDependency() { await _app.StartWatcherAsync(); diff --git a/src/Tools/dotnet-watch/test/DotNetWatcherTests.cs b/src/Tools/dotnet-watch/test/DotNetWatcherTests.cs index 3ef636b009..d07f4e25a4 100644 --- a/src/Tools/dotnet-watch/test/DotNetWatcherTests.cs +++ b/src/Tools/dotnet-watch/test/DotNetWatcherTests.cs @@ -23,7 +23,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task RunsWithDotnetWatchEnvVariable() { Assert.True(string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DOTNET_WATCH")), "DOTNET_WATCH cannot be set already when this test is running"); @@ -36,7 +36,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task RunsWithIterationEnvVariable() { await _app.StartWatcherAsync(); diff --git a/src/Tools/dotnet-watch/test/GlobbingAppTests.cs b/src/Tools/dotnet-watch/test/GlobbingAppTests.cs index 25dc5b3616..9383b2d728 100644 --- a/src/Tools/dotnet-watch/test/GlobbingAppTests.cs +++ b/src/Tools/dotnet-watch/test/GlobbingAppTests.cs @@ -24,7 +24,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests [Theory] [InlineData(true)] [InlineData(false)] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task ChangeCompiledFile(bool usePollingWatcher) { _app.UsePollingWatcher = usePollingWatcher; @@ -43,7 +43,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task DeleteCompiledFile() { await _app.StartWatcherAsync(); @@ -60,7 +60,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task DeleteSourceFolder() { await _app.StartWatcherAsync(); @@ -77,7 +77,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task RenameCompiledFile() { await _app.StartWatcherAsync(); @@ -90,7 +90,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task ChangeExcludedFile() { await _app.StartWatcherAsync(); diff --git a/src/Tools/dotnet-watch/test/NoDepsAppTests.cs b/src/Tools/dotnet-watch/test/NoDepsAppTests.cs index 5b1cc36788..b7171d5ad2 100644 --- a/src/Tools/dotnet-watch/test/NoDepsAppTests.cs +++ b/src/Tools/dotnet-watch/test/NoDepsAppTests.cs @@ -24,7 +24,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task RestartProcessOnFileChange() { await _app.StartWatcherAsync(new[] { "--no-exit" }); @@ -43,7 +43,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } [Fact] - [Flaky("", FlakyOn.All)] + [QuarantinedTest] public async Task RestartProcessThatTerminatesAfterFileChange() { await _app.StartWatcherAsync(); From 648d9e37a9e1494b6bc589a744c70adeaee5c0ad Mon Sep 17 00:00:00 2001 From: "msftbot[bot]" <48340428+msftbot[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2020 18:18:07 +0000 Subject: [PATCH 42/50] Fixed Typo in UrlDecoder.cs (#19565) --- src/Shared/UrlDecoder/UrlDecoder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Shared/UrlDecoder/UrlDecoder.cs b/src/Shared/UrlDecoder/UrlDecoder.cs index 5666f5b34f..9e01c15d5e 100644 --- a/src/Shared/UrlDecoder/UrlDecoder.cs +++ b/src/Shared/UrlDecoder/UrlDecoder.cs @@ -20,7 +20,7 @@ namespace Microsoft.AspNetCore.Internal if (destination.Length < source.Length) { throw new ArgumentException( - "Lenghth of the destination byte span is less then the source.", + "Length of the destination byte span is less then the source.", nameof(destination)); } From 3b4be4f51a39cd008cfc5c2eb0ef9854f9bcd649 Mon Sep 17 00:00:00 2001 From: Andrew Stanton-Nurse Date: Wed, 4 Mar 2020 11:27:55 -0800 Subject: [PATCH 43/50] Quarantining some tests (#19568) --- .../Authentication/Negotiate/test/Negotiate.Test/EventTests.cs | 2 ++ .../Microsoft.AspNetCore.Authentication.Negotiate.Test.csproj | 1 + .../Negotiate/test/Negotiate.Test/NegotiateHandlerTests.cs | 2 ++ .../Negotiate/test/Negotiate.Test/ServerDeferralTests.cs | 2 ++ .../InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs | 3 ++- .../Kestrel/test/InMemory.FunctionalTests/RequestTests.cs | 1 + .../Kestrel/test/InMemory.FunctionalTests/ResponseTests.cs | 1 + .../Interop.FunctionalTests/HttpClientHttp2InteropTests.cs | 1 + src/SignalR/server/SignalR/test/HubConnectionHandlerTests.cs | 1 + 9 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Security/Authentication/Negotiate/test/Negotiate.Test/EventTests.cs b/src/Security/Authentication/Negotiate/test/Negotiate.Test/EventTests.cs index 5ad64494b1..bc18f861b5 100644 --- a/src/Security/Authentication/Negotiate/test/Negotiate.Test/EventTests.cs +++ b/src/Security/Authentication/Negotiate/test/Negotiate.Test/EventTests.cs @@ -13,6 +13,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.TestHost; +using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Net.Http.Headers; @@ -20,6 +21,7 @@ using Xunit; namespace Microsoft.AspNetCore.Authentication.Negotiate { + [QuarantinedTest] public class EventTests { [Fact] diff --git a/src/Security/Authentication/Negotiate/test/Negotiate.Test/Microsoft.AspNetCore.Authentication.Negotiate.Test.csproj b/src/Security/Authentication/Negotiate/test/Negotiate.Test/Microsoft.AspNetCore.Authentication.Negotiate.Test.csproj index 7af38dfa4a..3f483fc9e1 100644 --- a/src/Security/Authentication/Negotiate/test/Negotiate.Test/Microsoft.AspNetCore.Authentication.Negotiate.Test.csproj +++ b/src/Security/Authentication/Negotiate/test/Negotiate.Test/Microsoft.AspNetCore.Authentication.Negotiate.Test.csproj @@ -12,6 +12,7 @@ + diff --git a/src/Security/Authentication/Negotiate/test/Negotiate.Test/NegotiateHandlerTests.cs b/src/Security/Authentication/Negotiate/test/Negotiate.Test/NegotiateHandlerTests.cs index be6593e543..89685b286b 100644 --- a/src/Security/Authentication/Negotiate/test/Negotiate.Test/NegotiateHandlerTests.cs +++ b/src/Security/Authentication/Negotiate/test/Negotiate.Test/NegotiateHandlerTests.cs @@ -13,6 +13,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.TestHost; +using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Net.Http.Headers; @@ -21,6 +22,7 @@ using Xunit.Sdk; namespace Microsoft.AspNetCore.Authentication.Negotiate { + [QuarantinedTest] public class NegotiateHandlerTests { [Fact] diff --git a/src/Security/Authentication/Negotiate/test/Negotiate.Test/ServerDeferralTests.cs b/src/Security/Authentication/Negotiate/test/Negotiate.Test/ServerDeferralTests.cs index eba5c12fea..e5cf8ca7b6 100644 --- a/src/Security/Authentication/Negotiate/test/Negotiate.Test/ServerDeferralTests.cs +++ b/src/Security/Authentication/Negotiate/test/Negotiate.Test/ServerDeferralTests.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting.Server; using Microsoft.AspNetCore.TestHost; +using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Options; @@ -14,6 +15,7 @@ using Xunit; namespace Microsoft.AspNetCore.Authentication.Negotiate { + [QuarantinedTest] public class ServerDeferralTests { [Fact] diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs index 486e046b7f..760713ba79 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs @@ -153,6 +153,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests } [Fact] + [QuarantinedTest] public async Task StreamPool_MultipleStreamsInSequence_PooledStreamReused() { TaskCompletionSource appDelegateTcs = null; @@ -1175,7 +1176,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests [Fact] public async Task Frame_MultipleStreams_CanBeCreatedIfClientCountIsLessThanActualMaxStreamCount() { - _serviceContext.ServerOptions.Limits.Http2.MaxStreamsPerConnection = 1; + _serviceContext.ServerOptions.Limits.Http2.MaxStreamsPerConnection = 1; var firstRequestBlock = new TaskCompletionSource(); var firstRequestReceived = new TaskCompletionSource(); var makeFirstRequestWait = false; diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/RequestTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/RequestTests.cs index bdad3c71c9..2e63e458ac 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/RequestTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/RequestTests.cs @@ -790,6 +790,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests } [Fact] + [QuarantinedTest] public async Task ContentLengthReadAsyncSingleBytesAtATime() { var testContext = new TestServiceContext(LoggerFactory); diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/ResponseTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/ResponseTests.cs index 91ce46fc53..0dca63fe5f 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/ResponseTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/ResponseTests.cs @@ -2541,6 +2541,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests } [Fact] + [QuarantinedTest] public async Task AppAbortViaIConnectionLifetimeFeatureIsLogged() { var testContext = new TestServiceContext(LoggerFactory); diff --git a/src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs b/src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs index a3ac8e7656..add7c0e2fd 100644 --- a/src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs +++ b/src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs @@ -1189,6 +1189,7 @@ namespace Interop.FunctionalTests // Nor does Kestrel yet support sending dynamic table updates, so there's nothing to test here. https://github.com/dotnet/aspnetcore/issues/4715 [Theory] + [QuarantinedTest] [MemberData(nameof(SupportedSchemes))] public async Task Settings_MaxConcurrentStreamsGet_Server(string scheme) { diff --git a/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.cs b/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.cs index d380cc318a..aaf4cfa582 100644 --- a/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.cs +++ b/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.cs @@ -2769,6 +2769,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests } [Fact] + [QuarantinedTest] public async Task ReceivingMessagesPreventsConnectionTimeoutFromOccuring() { using (StartVerifiableLog()) From 54d71af00dee23f67183d48c01e23ac1cc55fac8 Mon Sep 17 00:00:00 2001 From: "msftbot[bot]" <48340428+msftbot[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2020 21:07:18 +0000 Subject: [PATCH 44/50] Add example for UserLoginInfo's ProviderDisplayName property (#19357) --- src/Identity/Extensions.Core/src/UserLoginInfo.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Identity/Extensions.Core/src/UserLoginInfo.cs b/src/Identity/Extensions.Core/src/UserLoginInfo.cs index a05a12bb43..cc2cdddf35 100644 --- a/src/Identity/Extensions.Core/src/UserLoginInfo.cs +++ b/src/Identity/Extensions.Core/src/UserLoginInfo.cs @@ -47,6 +47,9 @@ namespace Microsoft.AspNetCore.Identity /// /// The display name for the provider. /// + /// + /// Examples of the display name may be local, FACEBOOK, Google, etc. + /// public string ProviderDisplayName { get; set; } } } \ No newline at end of file From 4192a023f550e375b4468ed72482d4ef5a0083f7 Mon Sep 17 00:00:00 2001 From: Artak <34246760+mkArtakMSFT@users.noreply.github.com> Date: Wed, 4 Mar 2020 15:26:19 -0800 Subject: [PATCH 45/50] Mark tests as flaky (#19415) * Mark tests as flaky * Update ComponentHubReliabilityTest.cs * Update InteropReliabilityTests.cs * Update ServerComponentRenderingTest.cs * Update ServerComponentRenderingTest.cs --- .../ServerExecutionTests/ComponentHubReliabilityTest.cs | 6 +----- .../ServerExecutionTests/InteropReliabilityTests.cs | 2 ++ .../ServerExecutionTests/ServerComponentRenderingTest.cs | 7 ++++++- .../test/E2ETest/Tests/ComponentRenderingTest.cs | 3 ++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Components/test/E2ETest/ServerExecutionTests/ComponentHubReliabilityTest.cs b/src/Components/test/E2ETest/ServerExecutionTests/ComponentHubReliabilityTest.cs index 52546042fb..774197872d 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/ComponentHubReliabilityTest.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/ComponentHubReliabilityTest.cs @@ -2,14 +2,9 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Collections.Generic; -using System.Text.Json; using System.Text.RegularExpressions; using System.Threading.Tasks; -using Ignitor; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; -using Microsoft.AspNetCore.Components.RenderTree; -using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.SignalR.Client; using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Logging; @@ -27,6 +22,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests } [Fact] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/19414")] public async Task CannotStartMultipleCircuits() { // Arrange diff --git a/src/Components/test/E2ETest/ServerExecutionTests/InteropReliabilityTests.cs b/src/Components/test/E2ETest/ServerExecutionTests/InteropReliabilityTests.cs index c3e0626eb6..288b3e7c8c 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/InteropReliabilityTests.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/InteropReliabilityTests.cs @@ -11,6 +11,7 @@ using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; using Microsoft.AspNetCore.Components.RenderTree; using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.SignalR.Client; +using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.Logging; using TestServer; using Xunit; @@ -213,6 +214,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests } [Fact] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/19410")] public async Task ContinuesWorkingAfterInvalidAsyncReturnCallback() { // Arrange diff --git a/src/Components/test/E2ETest/ServerExecutionTests/ServerComponentRenderingTest.cs b/src/Components/test/E2ETest/ServerExecutionTests/ServerComponentRenderingTest.cs index 25b7b552af..de7a9321e9 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/ServerComponentRenderingTest.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/ServerComponentRenderingTest.cs @@ -6,8 +6,8 @@ using BasicTestApp; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; using Microsoft.AspNetCore.Components.E2ETest.Tests; using Microsoft.AspNetCore.E2ETesting; +using Microsoft.AspNetCore.Testing; using OpenQA.Selenium; -using OpenQA.Selenium.Support.UI; using Xunit; using Xunit.Abstractions; @@ -35,5 +35,10 @@ namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests $"{typeof(InvalidOperationException).FullName}: The current thread is not associated with the Dispatcher. Use InvokeAsync() to switch execution to the Dispatcher when triggering rendering or component state.", () => result.Text); } + + [Fact] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/19413")] + public override void CanDispatchAsyncWorkToSyncContext() + => base.CanDispatchAsyncWorkToSyncContext(); } } diff --git a/src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs b/src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs index ca9af22c99..372995c2f5 100644 --- a/src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs +++ b/src/Components/test/E2ETest/Tests/ComponentRenderingTest.cs @@ -12,6 +12,7 @@ using BasicTestApp.HierarchicalImportsTest.Subdir; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure; using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures; using Microsoft.AspNetCore.E2ETesting; +using Microsoft.AspNetCore.Testing; using OpenQA.Selenium; using OpenQA.Selenium.Support.UI; using Xunit; @@ -579,7 +580,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Tests } [Fact] - public void CanDispatchAsyncWorkToSyncContext() + public virtual void CanDispatchAsyncWorkToSyncContext() { var appElement = Browser.MountTestComponent(); var result = appElement.FindElement(By.Id("result")); From d71a61ded8cc32c4b541eb954635c44dfae4aab8 Mon Sep 17 00:00:00 2001 From: Artak <34246760+mkArtakMSFT@users.noreply.github.com> Date: Wed, 4 Mar 2020 16:34:31 -0800 Subject: [PATCH 46/50] Quarantine the `ReactTemplate_IndividualAuth_NetCore` test (#19584) --- src/ProjectTemplates/test/SpaTemplateTest/ReactTemplateTest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ProjectTemplates/test/SpaTemplateTest/ReactTemplateTest.cs b/src/ProjectTemplates/test/SpaTemplateTest/ReactTemplateTest.cs index a2e1c1c368..9e591ff67d 100644 --- a/src/ProjectTemplates/test/SpaTemplateTest/ReactTemplateTest.cs +++ b/src/ProjectTemplates/test/SpaTemplateTest/ReactTemplateTest.cs @@ -22,6 +22,7 @@ namespace Templates.Test.SpaTemplateTest public Task ReactTemplate_Works_NetCore() => SpaTemplateImplAsync("reactnoauth", "react", useLocalDb: false, usesAuth: false); + [QuarantinedTest] [ConditionalFact] [SkipOnHelix("selenium")] public Task ReactTemplate_IndividualAuth_NetCore() From 3925546732fec63625fce47db5a2eab199bed4da Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Thu, 5 Mar 2020 14:28:02 +1300 Subject: [PATCH 47/50] Reset Http2Stream when it starts (#19589) --- .../Core/src/Internal/Http/Http1Connection.cs | 2 +- .../Core/src/Internal/Http/HttpProtocol.cs | 7 ++----- .../Core/src/Internal/Http2/Http2Stream.cs | 19 +++---------------- .../Core/src/Internal/Http2/Http2StreamOfT.cs | 2 +- .../Core/src/Internal/Http3/Http3Stream.cs | 2 +- .../HttpProtocolFeatureCollectionTests.cs | 2 +- .../Http2/Http2ConnectionTests.cs | 5 ----- 7 files changed, 9 insertions(+), 30 deletions(-) diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/Http1Connection.cs b/src/Servers/Kestrel/Core/src/Internal/Http/Http1Connection.cs index ab341a8e53..832d48cdce 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/Http1Connection.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/Http1Connection.cs @@ -45,7 +45,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http public Http1Connection(HttpConnectionContext context) { - Initialize(context, reset: true); + Initialize(context); _context = context; _parser = ServiceContext.HttpParser; diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs b/src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs index 87dc89f6d3..539c386efa 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs @@ -76,16 +76,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http private Stream _requestStreamInternal; private Stream _responseStreamInternal; - public void Initialize(HttpConnectionContext context, bool reset) + public void Initialize(HttpConnectionContext context) { _context = context; ServerOptions = ServiceContext.ServerOptions; - if (reset) - { - Reset(); - } + Reset(); HttpResponseControl = this; } diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs index 9853a184a0..b3dccb8a23 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs @@ -33,18 +33,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 private StreamCompletionFlags _completionState; private readonly object _completionLock = new object(); - /// - /// Initialize the stream with the specified context. - /// - /// The context. - /// - /// A value indicating whether to reset the protocol instance. - /// We want to reset when the stream is created, and when the stream is returned to the pool. - /// The stream shouldn't be reset when fetched from the pool. - /// - public void InitializePooled(Http2StreamContext context, bool reset) + public void Initialize(Http2StreamContext context) { - base.Initialize(context, reset); + base.Initialize(context); _decrementCalled = false; _completionState = StreamCompletionFlags.None; @@ -81,9 +72,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 { _context.StreamId = streamId; - // The stream was reset when it was completed. - // We don't want to reset it twice because reused headers will be discarded. - InitializePooled(_context, reset: false); + Initialize(_context); } public int StreamId => _context.StreamId; @@ -155,8 +144,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 // The app can no longer read any more of the request body, so return any bytes that weren't read to the // connection's flow-control window. _inputFlowControl.Abort(); - - Reset(); } finally { diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2StreamOfT.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2StreamOfT.cs index ef6c790f1d..2ba223f43c 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2StreamOfT.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2StreamOfT.cs @@ -13,7 +13,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 public Http2Stream(IHttpApplication application, Http2StreamContext context) { - InitializePooled(context, reset: true); + Initialize(context); _application = application; } diff --git a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs index 3a4abf8590..6518d00afd 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs @@ -52,7 +52,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http3 public Http3Stream(Http3Connection http3Connection, Http3StreamContext context) { - Initialize(context, reset: true); + Initialize(context); InputRemaining = null; diff --git a/src/Servers/Kestrel/Core/test/HttpProtocolFeatureCollectionTests.cs b/src/Servers/Kestrel/Core/test/HttpProtocolFeatureCollectionTests.cs index 789d93dfe5..f62bad9117 100644 --- a/src/Servers/Kestrel/Core/test/HttpProtocolFeatureCollectionTests.cs +++ b/src/Servers/Kestrel/Core/test/HttpProtocolFeatureCollectionTests.cs @@ -251,7 +251,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests { public TestHttp2Stream(Http2StreamContext context) { - InitializePooled(context, reset: true); + Initialize(context); } public override void Execute() diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs index 760713ba79..7d93bdce3a 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs @@ -234,11 +234,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // Stream returned to the pool Assert.Equal(1, _connection.StreamPool.Count); - Assert.True(_connection.StreamPool.TryPop(out var stream)); - - // Stream has been completed and reset before being returned - Assert.Empty(stream.RequestHeaders); - await StopConnectionAsync(expectedLastStreamId: 3, ignoreNonGoAwayFrames: false); } From 47cc418dec845031f26cc93170ab26c9ad890a07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Ros?= Date: Wed, 4 Mar 2020 17:46:14 -0800 Subject: [PATCH 48/50] Update dependencies (#19587) --- eng/Version.Details.xml | 324 ++++++++++++++++++++-------------------- eng/Versions.props | 161 ++++++++++---------- 2 files changed, 240 insertions(+), 245 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b3285bb916..88b8feee05 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -13,328 +13,328 @@ https://github.com/dotnet/blazor dd7fb4d3931d556458f62642c2edfc59f6295bfb - + https://github.com/dotnet/aspnetcore-tooling - df809abb8a1c7885496b799206999bb8f6e65091 + 33a9f3ca20e57e7fb69fd90b9aa9b2278f377a54 - + https://github.com/dotnet/aspnetcore-tooling - df809abb8a1c7885496b799206999bb8f6e65091 + 33a9f3ca20e57e7fb69fd90b9aa9b2278f377a54 - + https://github.com/dotnet/aspnetcore-tooling - df809abb8a1c7885496b799206999bb8f6e65091 + 33a9f3ca20e57e7fb69fd90b9aa9b2278f377a54 - + https://github.com/dotnet/aspnetcore-tooling - df809abb8a1c7885496b799206999bb8f6e65091 + 33a9f3ca20e57e7fb69fd90b9aa9b2278f377a54 - + https://github.com/dotnet/efcore - 725adf77d3a08d99ce59787354d391176c3844b7 + b8dca3aff593904a687514881c32c9359bbea6df - + https://github.com/dotnet/efcore - 725adf77d3a08d99ce59787354d391176c3844b7 + b8dca3aff593904a687514881c32c9359bbea6df - + https://github.com/dotnet/efcore - 725adf77d3a08d99ce59787354d391176c3844b7 + b8dca3aff593904a687514881c32c9359bbea6df - + https://github.com/dotnet/efcore - 725adf77d3a08d99ce59787354d391176c3844b7 + b8dca3aff593904a687514881c32c9359bbea6df - + https://github.com/dotnet/efcore - 725adf77d3a08d99ce59787354d391176c3844b7 + b8dca3aff593904a687514881c32c9359bbea6df - + https://github.com/dotnet/efcore - 725adf77d3a08d99ce59787354d391176c3844b7 + b8dca3aff593904a687514881c32c9359bbea6df - + https://github.com/dotnet/efcore - 725adf77d3a08d99ce59787354d391176c3844b7 + b8dca3aff593904a687514881c32c9359bbea6df - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/runtime - 6d9e5035905ae71b5fceeb8bb5a2c01f7622b7f6 + 9bcf3b12f4e7ad2667ca00afc804877d78b81a46 - + https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 + a1c36119ce1b3ff9a7a69f7b088b9601962e58e2 https://github.com/dotnet/arcade @@ -348,13 +348,9 @@ https://github.com/dotnet/arcade 8ccad075bbb0db445e03eed0a6073d27bdd4f31a - - https://github.com/dotnet/extensions - af32a19e60acbeac59ec1dd73865dfa3d3d5dca4 - - + https://github.com/dotnet/roslyn - 8f010124a3a323b34f561d062025258668d91539 + 20b9af913f1b8ce0a62f72bea9e75e4aa3cf6b0e diff --git a/eng/Versions.props b/eng/Versions.props index 567b25138b..e486eac065 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -64,95 +64,94 @@ 5.0.0-beta.20151.1 - 3.5.0-beta4-20128-03 + 3.5.0-beta4-20153-05 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 2.1.0-preview.2.20129.8 + 5.0.0-preview.2-runtime.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 2.1.0-preview.2.20154.1 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 - 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 - 5.0.0-preview.2.20129.8 + 5.0.0-preview.2.20154.1 3.2.0-preview1.20067.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 - 5.0.0-preview.2.20151.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 - 5.0.0-preview.2.20152.2 - 5.0.0-preview.2.20152.2 - 5.0.0-preview.2.20152.2 - 5.0.0-preview.2.20152.2 - 5.0.0-preview.2.20152.2 - 5.0.0-preview.2.20152.2 - 5.0.0-preview.2.20152.2 + 5.0.0-preview.2.20154.2 + 5.0.0-preview.2.20154.2 + 5.0.0-preview.2.20154.2 + 5.0.0-preview.2.20154.2 + 5.0.0-preview.2.20154.2 + 5.0.0-preview.2.20154.2 + 5.0.0-preview.2.20154.2 - 5.0.0-preview.2.20152.1 - 5.0.0-preview.2.20152.1 - 5.0.0-preview.2.20152.1 - 5.0.0-preview.2.20152.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 + 5.0.0-preview.2.20154.1 - 5.0.0-preview.2.20154.2 - 5.0.0-preview.2.20154.2 - 5.0.0-preview.2.20154.2 - 5.0.0-preview.2.20154.2 - 5.0.0-preview.2.20154.2 - 5.0.0-preview.2.20154.2 - 5.0.0-preview.2.20154.2 + 5.0.0-preview.2.20154.4 + 5.0.0-preview.2.20154.4 + 5.0.0-preview.2.20154.4 + 5.0.0-preview.2.20154.4 + 5.0.0-preview.2.20154.4 + 5.0.0-preview.2.20154.4 + 5.0.0-preview.2.20154.4 5.0.0-preview.2.20154.1 5.0.0-preview.2.20154.1 From 5aa86873c30f1f4643c801bd303901fb66af8b09 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Thu, 5 Mar 2020 17:08:53 +1300 Subject: [PATCH 50/50] Add HTTP/2 HPack static compression (#19521) --- .../Internal/Http/HttpHeaders.Generated.cs | 173 +++++++++++ .../src/Internal/Http/HttpRequestHeaders.cs | 4 + .../src/Internal/Http/HttpResponseHeaders.cs | 4 + .../src/Internal/Http/HttpResponseTrailers.cs | 4 + .../src/Internal/Http2/HPackHeaderWriter.cs | 157 ++++++++++ .../src/Internal/Http2/Http2FrameWriter.cs | 8 +- .../Internal/Http2/Http2HeaderEnumerator.cs | 8 + ...oderTests.cs => HPackHeaderWriterTests.cs} | 23 +- .../Http2ConnectionBenchmark.cs | 7 +- src/Servers/Kestrel/shared/KnownHeaders.cs | 12 + .../test/PipeWriterHttp2FrameExtensions.cs | 22 +- .../Http2/Http2ConnectionTests.cs | 137 ++++----- .../Http2/Http2StreamTests.cs | 209 +++++++------ .../Http2/Http2TestBase.cs | 40 ++- .../Http2/Http2TimeoutTests.cs | 32 +- .../HttpClientHttp2InteropTests.cs | 2 +- src/Shared/Http2cat/HPackHeaderWriter.cs | 91 ++++++ src/Shared/Http2cat/Http2Utilities.cs | 26 +- .../runtime/Http2/Hpack/H2StaticTable.cs | 1 + .../runtime/Http2/Hpack/HPackEncoder.cs | 275 +++++++----------- 20 files changed, 828 insertions(+), 407 deletions(-) create mode 100644 src/Servers/Kestrel/Core/src/Internal/Http2/HPackHeaderWriter.cs rename src/Servers/Kestrel/Core/test/{HPackEncoderTests.cs => HPackHeaderWriterTests.cs} (89%) create mode 100644 src/Shared/Http2cat/HPackHeaderWriter.cs diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.Generated.cs b/src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.Generated.cs index 0f8783e717..516d7c32ec 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.Generated.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpHeaders.Generated.cs @@ -14,6 +14,81 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http { + internal enum KnownHeaderType + { + Unknown, + Accept, + AcceptCharset, + AcceptEncoding, + AcceptLanguage, + AcceptRanges, + AccessControlAllowCredentials, + AccessControlAllowHeaders, + AccessControlAllowMethods, + AccessControlAllowOrigin, + AccessControlExposeHeaders, + AccessControlMaxAge, + AccessControlRequestHeaders, + AccessControlRequestMethod, + Age, + Allow, + AltSvc, + Authority, + Authorization, + CacheControl, + Connection, + ContentEncoding, + ContentLanguage, + ContentLength, + ContentLocation, + ContentMD5, + ContentRange, + ContentType, + Cookie, + CorrelationContext, + Date, + DNT, + ETag, + Expect, + Expires, + From, + Host, + IfMatch, + IfModifiedSince, + IfNoneMatch, + IfRange, + IfUnmodifiedSince, + KeepAlive, + LastModified, + Location, + MaxForwards, + Method, + Origin, + Path, + Pragma, + ProxyAuthenticate, + ProxyAuthorization, + Range, + Referer, + RequestId, + RetryAfter, + Scheme, + Server, + SetCookie, + TE, + TraceParent, + TraceState, + Trailer, + TransferEncoding, + Translate, + Upgrade, + UpgradeInsecureRequests, + UserAgent, + Vary, + Via, + Warning, + WWWAuthenticate, + } internal partial class HttpRequestHeaders { @@ -6751,6 +6826,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x1L) != 0) { _current = new KeyValuePair(HeaderNames.CacheControl, _collection._headers._CacheControl); + _currentKnownType = KnownHeaderType.CacheControl; _next = 1; return true; } @@ -6758,6 +6834,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x2L) != 0) { _current = new KeyValuePair(HeaderNames.Connection, _collection._headers._Connection); + _currentKnownType = KnownHeaderType.Connection; _next = 2; return true; } @@ -6765,6 +6842,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x4L) != 0) { _current = new KeyValuePair(HeaderNames.Date, _collection._headers._Date); + _currentKnownType = KnownHeaderType.Date; _next = 3; return true; } @@ -6772,6 +6850,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x8L) != 0) { _current = new KeyValuePair(HeaderNames.KeepAlive, _collection._headers._KeepAlive); + _currentKnownType = KnownHeaderType.KeepAlive; _next = 4; return true; } @@ -6779,6 +6858,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x10L) != 0) { _current = new KeyValuePair(HeaderNames.Pragma, _collection._headers._Pragma); + _currentKnownType = KnownHeaderType.Pragma; _next = 5; return true; } @@ -6786,6 +6866,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x20L) != 0) { _current = new KeyValuePair(HeaderNames.Trailer, _collection._headers._Trailer); + _currentKnownType = KnownHeaderType.Trailer; _next = 6; return true; } @@ -6793,6 +6874,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x40L) != 0) { _current = new KeyValuePair(HeaderNames.TransferEncoding, _collection._headers._TransferEncoding); + _currentKnownType = KnownHeaderType.TransferEncoding; _next = 7; return true; } @@ -6800,6 +6882,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x80L) != 0) { _current = new KeyValuePair(HeaderNames.Upgrade, _collection._headers._Upgrade); + _currentKnownType = KnownHeaderType.Upgrade; _next = 8; return true; } @@ -6807,6 +6890,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x100L) != 0) { _current = new KeyValuePair(HeaderNames.Via, _collection._headers._Via); + _currentKnownType = KnownHeaderType.Via; _next = 9; return true; } @@ -6814,6 +6898,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x200L) != 0) { _current = new KeyValuePair(HeaderNames.Warning, _collection._headers._Warning); + _currentKnownType = KnownHeaderType.Warning; _next = 10; return true; } @@ -6821,6 +6906,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x400L) != 0) { _current = new KeyValuePair(HeaderNames.Allow, _collection._headers._Allow); + _currentKnownType = KnownHeaderType.Allow; _next = 11; return true; } @@ -6828,6 +6914,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x800L) != 0) { _current = new KeyValuePair(HeaderNames.ContentType, _collection._headers._ContentType); + _currentKnownType = KnownHeaderType.ContentType; _next = 12; return true; } @@ -6835,6 +6922,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x1000L) != 0) { _current = new KeyValuePair(HeaderNames.ContentEncoding, _collection._headers._ContentEncoding); + _currentKnownType = KnownHeaderType.ContentEncoding; _next = 13; return true; } @@ -6842,6 +6930,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x2000L) != 0) { _current = new KeyValuePair(HeaderNames.ContentLanguage, _collection._headers._ContentLanguage); + _currentKnownType = KnownHeaderType.ContentLanguage; _next = 14; return true; } @@ -6849,6 +6938,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x4000L) != 0) { _current = new KeyValuePair(HeaderNames.ContentLocation, _collection._headers._ContentLocation); + _currentKnownType = KnownHeaderType.ContentLocation; _next = 15; return true; } @@ -6856,6 +6946,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x8000L) != 0) { _current = new KeyValuePair(HeaderNames.ContentMD5, _collection._headers._ContentMD5); + _currentKnownType = KnownHeaderType.ContentMD5; _next = 16; return true; } @@ -6863,6 +6954,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x10000L) != 0) { _current = new KeyValuePair(HeaderNames.ContentRange, _collection._headers._ContentRange); + _currentKnownType = KnownHeaderType.ContentRange; _next = 17; return true; } @@ -6870,6 +6962,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x20000L) != 0) { _current = new KeyValuePair(HeaderNames.Expires, _collection._headers._Expires); + _currentKnownType = KnownHeaderType.Expires; _next = 18; return true; } @@ -6877,6 +6970,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x40000L) != 0) { _current = new KeyValuePair(HeaderNames.LastModified, _collection._headers._LastModified); + _currentKnownType = KnownHeaderType.LastModified; _next = 19; return true; } @@ -6884,6 +6978,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x80000L) != 0) { _current = new KeyValuePair(HeaderNames.Authority, _collection._headers._Authority); + _currentKnownType = KnownHeaderType.Authority; _next = 20; return true; } @@ -6891,6 +6986,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x100000L) != 0) { _current = new KeyValuePair(HeaderNames.Method, _collection._headers._Method); + _currentKnownType = KnownHeaderType.Method; _next = 21; return true; } @@ -6898,6 +6994,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x200000L) != 0) { _current = new KeyValuePair(HeaderNames.Path, _collection._headers._Path); + _currentKnownType = KnownHeaderType.Path; _next = 22; return true; } @@ -6905,6 +7002,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x400000L) != 0) { _current = new KeyValuePair(HeaderNames.Scheme, _collection._headers._Scheme); + _currentKnownType = KnownHeaderType.Scheme; _next = 23; return true; } @@ -6912,6 +7010,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x800000L) != 0) { _current = new KeyValuePair(HeaderNames.Accept, _collection._headers._Accept); + _currentKnownType = KnownHeaderType.Accept; _next = 24; return true; } @@ -6919,6 +7018,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x1000000L) != 0) { _current = new KeyValuePair(HeaderNames.AcceptCharset, _collection._headers._AcceptCharset); + _currentKnownType = KnownHeaderType.AcceptCharset; _next = 25; return true; } @@ -6926,6 +7026,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x2000000L) != 0) { _current = new KeyValuePair(HeaderNames.AcceptEncoding, _collection._headers._AcceptEncoding); + _currentKnownType = KnownHeaderType.AcceptEncoding; _next = 26; return true; } @@ -6933,6 +7034,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x4000000L) != 0) { _current = new KeyValuePair(HeaderNames.AcceptLanguage, _collection._headers._AcceptLanguage); + _currentKnownType = KnownHeaderType.AcceptLanguage; _next = 27; return true; } @@ -6940,6 +7042,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x8000000L) != 0) { _current = new KeyValuePair(HeaderNames.Authorization, _collection._headers._Authorization); + _currentKnownType = KnownHeaderType.Authorization; _next = 28; return true; } @@ -6947,6 +7050,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x10000000L) != 0) { _current = new KeyValuePair(HeaderNames.Cookie, _collection._headers._Cookie); + _currentKnownType = KnownHeaderType.Cookie; _next = 29; return true; } @@ -6954,6 +7058,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x20000000L) != 0) { _current = new KeyValuePair(HeaderNames.Expect, _collection._headers._Expect); + _currentKnownType = KnownHeaderType.Expect; _next = 30; return true; } @@ -6961,6 +7066,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x40000000L) != 0) { _current = new KeyValuePair(HeaderNames.From, _collection._headers._From); + _currentKnownType = KnownHeaderType.From; _next = 31; return true; } @@ -6968,6 +7074,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x80000000L) != 0) { _current = new KeyValuePair(HeaderNames.Host, _collection._headers._Host); + _currentKnownType = KnownHeaderType.Host; _next = 32; return true; } @@ -6975,6 +7082,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x100000000L) != 0) { _current = new KeyValuePair(HeaderNames.IfMatch, _collection._headers._IfMatch); + _currentKnownType = KnownHeaderType.IfMatch; _next = 33; return true; } @@ -6982,6 +7090,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x200000000L) != 0) { _current = new KeyValuePair(HeaderNames.IfModifiedSince, _collection._headers._IfModifiedSince); + _currentKnownType = KnownHeaderType.IfModifiedSince; _next = 34; return true; } @@ -6989,6 +7098,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x400000000L) != 0) { _current = new KeyValuePair(HeaderNames.IfNoneMatch, _collection._headers._IfNoneMatch); + _currentKnownType = KnownHeaderType.IfNoneMatch; _next = 35; return true; } @@ -6996,6 +7106,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x800000000L) != 0) { _current = new KeyValuePair(HeaderNames.IfRange, _collection._headers._IfRange); + _currentKnownType = KnownHeaderType.IfRange; _next = 36; return true; } @@ -7003,6 +7114,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x1000000000L) != 0) { _current = new KeyValuePair(HeaderNames.IfUnmodifiedSince, _collection._headers._IfUnmodifiedSince); + _currentKnownType = KnownHeaderType.IfUnmodifiedSince; _next = 37; return true; } @@ -7010,6 +7122,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x2000000000L) != 0) { _current = new KeyValuePair(HeaderNames.MaxForwards, _collection._headers._MaxForwards); + _currentKnownType = KnownHeaderType.MaxForwards; _next = 38; return true; } @@ -7017,6 +7130,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x4000000000L) != 0) { _current = new KeyValuePair(HeaderNames.ProxyAuthorization, _collection._headers._ProxyAuthorization); + _currentKnownType = KnownHeaderType.ProxyAuthorization; _next = 39; return true; } @@ -7024,6 +7138,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x8000000000L) != 0) { _current = new KeyValuePair(HeaderNames.Referer, _collection._headers._Referer); + _currentKnownType = KnownHeaderType.Referer; _next = 40; return true; } @@ -7031,6 +7146,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x10000000000L) != 0) { _current = new KeyValuePair(HeaderNames.Range, _collection._headers._Range); + _currentKnownType = KnownHeaderType.Range; _next = 41; return true; } @@ -7038,6 +7154,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x20000000000L) != 0) { _current = new KeyValuePair(HeaderNames.TE, _collection._headers._TE); + _currentKnownType = KnownHeaderType.TE; _next = 42; return true; } @@ -7045,6 +7162,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x40000000000L) != 0) { _current = new KeyValuePair(HeaderNames.Translate, _collection._headers._Translate); + _currentKnownType = KnownHeaderType.Translate; _next = 43; return true; } @@ -7052,6 +7170,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x80000000000L) != 0) { _current = new KeyValuePair(HeaderNames.UserAgent, _collection._headers._UserAgent); + _currentKnownType = KnownHeaderType.UserAgent; _next = 44; return true; } @@ -7059,6 +7178,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x100000000000L) != 0) { _current = new KeyValuePair(HeaderNames.DNT, _collection._headers._DNT); + _currentKnownType = KnownHeaderType.DNT; _next = 45; return true; } @@ -7066,6 +7186,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x200000000000L) != 0) { _current = new KeyValuePair(HeaderNames.UpgradeInsecureRequests, _collection._headers._UpgradeInsecureRequests); + _currentKnownType = KnownHeaderType.UpgradeInsecureRequests; _next = 46; return true; } @@ -7073,6 +7194,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x400000000000L) != 0) { _current = new KeyValuePair(HeaderNames.RequestId, _collection._headers._RequestId); + _currentKnownType = KnownHeaderType.RequestId; _next = 47; return true; } @@ -7080,6 +7202,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x800000000000L) != 0) { _current = new KeyValuePair(HeaderNames.CorrelationContext, _collection._headers._CorrelationContext); + _currentKnownType = KnownHeaderType.CorrelationContext; _next = 48; return true; } @@ -7087,6 +7210,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x1000000000000L) != 0) { _current = new KeyValuePair(HeaderNames.TraceParent, _collection._headers._TraceParent); + _currentKnownType = KnownHeaderType.TraceParent; _next = 49; return true; } @@ -7094,6 +7218,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x2000000000000L) != 0) { _current = new KeyValuePair(HeaderNames.TraceState, _collection._headers._TraceState); + _currentKnownType = KnownHeaderType.TraceState; _next = 50; return true; } @@ -7101,6 +7226,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x4000000000000L) != 0) { _current = new KeyValuePair(HeaderNames.Origin, _collection._headers._Origin); + _currentKnownType = KnownHeaderType.Origin; _next = 51; return true; } @@ -7108,6 +7234,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x8000000000000L) != 0) { _current = new KeyValuePair(HeaderNames.AccessControlRequestMethod, _collection._headers._AccessControlRequestMethod); + _currentKnownType = KnownHeaderType.AccessControlRequestMethod; _next = 52; return true; } @@ -7115,6 +7242,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x10000000000000L) != 0) { _current = new KeyValuePair(HeaderNames.AccessControlRequestHeaders, _collection._headers._AccessControlRequestHeaders); + _currentKnownType = KnownHeaderType.AccessControlRequestHeaders; _next = 53; return true; } @@ -7122,6 +7250,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (_collection._contentLength.HasValue) { _current = new KeyValuePair(HeaderNames.ContentLength, HeaderUtilities.FormatNonNegativeInt64(_collection._contentLength.Value)); + _currentKnownType = KnownHeaderType.ContentLength; _next = 54; return true; } @@ -7129,9 +7258,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (!_hasUnknown || !_unknownEnumerator.MoveNext()) { _current = default(KeyValuePair); + _currentKnownType = default; return false; } _current = _unknownEnumerator.Current; + _currentKnownType = KnownHeaderType.Unknown; return true; } } @@ -12161,6 +12292,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x1L) != 0) { _current = new KeyValuePair(HeaderNames.CacheControl, _collection._headers._CacheControl); + _currentKnownType = KnownHeaderType.CacheControl; _next = 1; return true; } @@ -12168,6 +12300,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x2L) != 0) { _current = new KeyValuePair(HeaderNames.Connection, _collection._headers._Connection); + _currentKnownType = KnownHeaderType.Connection; _next = 2; return true; } @@ -12175,6 +12308,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x4L) != 0) { _current = new KeyValuePair(HeaderNames.Date, _collection._headers._Date); + _currentKnownType = KnownHeaderType.Date; _next = 3; return true; } @@ -12182,6 +12316,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x8L) != 0) { _current = new KeyValuePair(HeaderNames.KeepAlive, _collection._headers._KeepAlive); + _currentKnownType = KnownHeaderType.KeepAlive; _next = 4; return true; } @@ -12189,6 +12324,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x10L) != 0) { _current = new KeyValuePair(HeaderNames.Pragma, _collection._headers._Pragma); + _currentKnownType = KnownHeaderType.Pragma; _next = 5; return true; } @@ -12196,6 +12332,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x20L) != 0) { _current = new KeyValuePair(HeaderNames.Trailer, _collection._headers._Trailer); + _currentKnownType = KnownHeaderType.Trailer; _next = 6; return true; } @@ -12203,6 +12340,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x40L) != 0) { _current = new KeyValuePair(HeaderNames.TransferEncoding, _collection._headers._TransferEncoding); + _currentKnownType = KnownHeaderType.TransferEncoding; _next = 7; return true; } @@ -12210,6 +12348,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x80L) != 0) { _current = new KeyValuePair(HeaderNames.Upgrade, _collection._headers._Upgrade); + _currentKnownType = KnownHeaderType.Upgrade; _next = 8; return true; } @@ -12217,6 +12356,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x100L) != 0) { _current = new KeyValuePair(HeaderNames.Via, _collection._headers._Via); + _currentKnownType = KnownHeaderType.Via; _next = 9; return true; } @@ -12224,6 +12364,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x200L) != 0) { _current = new KeyValuePair(HeaderNames.Warning, _collection._headers._Warning); + _currentKnownType = KnownHeaderType.Warning; _next = 10; return true; } @@ -12231,6 +12372,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x400L) != 0) { _current = new KeyValuePair(HeaderNames.Allow, _collection._headers._Allow); + _currentKnownType = KnownHeaderType.Allow; _next = 11; return true; } @@ -12238,6 +12380,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x800L) != 0) { _current = new KeyValuePair(HeaderNames.ContentType, _collection._headers._ContentType); + _currentKnownType = KnownHeaderType.ContentType; _next = 12; return true; } @@ -12245,6 +12388,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x1000L) != 0) { _current = new KeyValuePair(HeaderNames.ContentEncoding, _collection._headers._ContentEncoding); + _currentKnownType = KnownHeaderType.ContentEncoding; _next = 13; return true; } @@ -12252,6 +12396,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x2000L) != 0) { _current = new KeyValuePair(HeaderNames.ContentLanguage, _collection._headers._ContentLanguage); + _currentKnownType = KnownHeaderType.ContentLanguage; _next = 14; return true; } @@ -12259,6 +12404,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x4000L) != 0) { _current = new KeyValuePair(HeaderNames.ContentLocation, _collection._headers._ContentLocation); + _currentKnownType = KnownHeaderType.ContentLocation; _next = 15; return true; } @@ -12266,6 +12412,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x8000L) != 0) { _current = new KeyValuePair(HeaderNames.ContentMD5, _collection._headers._ContentMD5); + _currentKnownType = KnownHeaderType.ContentMD5; _next = 16; return true; } @@ -12273,6 +12420,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x10000L) != 0) { _current = new KeyValuePair(HeaderNames.ContentRange, _collection._headers._ContentRange); + _currentKnownType = KnownHeaderType.ContentRange; _next = 17; return true; } @@ -12280,6 +12428,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x20000L) != 0) { _current = new KeyValuePair(HeaderNames.Expires, _collection._headers._Expires); + _currentKnownType = KnownHeaderType.Expires; _next = 18; return true; } @@ -12287,6 +12436,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x40000L) != 0) { _current = new KeyValuePair(HeaderNames.LastModified, _collection._headers._LastModified); + _currentKnownType = KnownHeaderType.LastModified; _next = 19; return true; } @@ -12294,6 +12444,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x80000L) != 0) { _current = new KeyValuePair(HeaderNames.AcceptRanges, _collection._headers._AcceptRanges); + _currentKnownType = KnownHeaderType.AcceptRanges; _next = 20; return true; } @@ -12301,6 +12452,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x100000L) != 0) { _current = new KeyValuePair(HeaderNames.Age, _collection._headers._Age); + _currentKnownType = KnownHeaderType.Age; _next = 21; return true; } @@ -12308,6 +12460,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x200000L) != 0) { _current = new KeyValuePair(HeaderNames.AltSvc, _collection._headers._AltSvc); + _currentKnownType = KnownHeaderType.AltSvc; _next = 22; return true; } @@ -12315,6 +12468,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x400000L) != 0) { _current = new KeyValuePair(HeaderNames.ETag, _collection._headers._ETag); + _currentKnownType = KnownHeaderType.ETag; _next = 23; return true; } @@ -12322,6 +12476,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x800000L) != 0) { _current = new KeyValuePair(HeaderNames.Location, _collection._headers._Location); + _currentKnownType = KnownHeaderType.Location; _next = 24; return true; } @@ -12329,6 +12484,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x1000000L) != 0) { _current = new KeyValuePair(HeaderNames.ProxyAuthenticate, _collection._headers._ProxyAuthenticate); + _currentKnownType = KnownHeaderType.ProxyAuthenticate; _next = 25; return true; } @@ -12336,6 +12492,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x2000000L) != 0) { _current = new KeyValuePair(HeaderNames.RetryAfter, _collection._headers._RetryAfter); + _currentKnownType = KnownHeaderType.RetryAfter; _next = 26; return true; } @@ -12343,6 +12500,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x4000000L) != 0) { _current = new KeyValuePair(HeaderNames.Server, _collection._headers._Server); + _currentKnownType = KnownHeaderType.Server; _next = 27; return true; } @@ -12350,6 +12508,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x8000000L) != 0) { _current = new KeyValuePair(HeaderNames.SetCookie, _collection._headers._SetCookie); + _currentKnownType = KnownHeaderType.SetCookie; _next = 28; return true; } @@ -12357,6 +12516,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x10000000L) != 0) { _current = new KeyValuePair(HeaderNames.Vary, _collection._headers._Vary); + _currentKnownType = KnownHeaderType.Vary; _next = 29; return true; } @@ -12364,6 +12524,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x20000000L) != 0) { _current = new KeyValuePair(HeaderNames.WWWAuthenticate, _collection._headers._WWWAuthenticate); + _currentKnownType = KnownHeaderType.WWWAuthenticate; _next = 30; return true; } @@ -12371,6 +12532,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x40000000L) != 0) { _current = new KeyValuePair(HeaderNames.AccessControlAllowCredentials, _collection._headers._AccessControlAllowCredentials); + _currentKnownType = KnownHeaderType.AccessControlAllowCredentials; _next = 31; return true; } @@ -12378,6 +12540,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x80000000L) != 0) { _current = new KeyValuePair(HeaderNames.AccessControlAllowHeaders, _collection._headers._AccessControlAllowHeaders); + _currentKnownType = KnownHeaderType.AccessControlAllowHeaders; _next = 32; return true; } @@ -12385,6 +12548,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x100000000L) != 0) { _current = new KeyValuePair(HeaderNames.AccessControlAllowMethods, _collection._headers._AccessControlAllowMethods); + _currentKnownType = KnownHeaderType.AccessControlAllowMethods; _next = 33; return true; } @@ -12392,6 +12556,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x200000000L) != 0) { _current = new KeyValuePair(HeaderNames.AccessControlAllowOrigin, _collection._headers._AccessControlAllowOrigin); + _currentKnownType = KnownHeaderType.AccessControlAllowOrigin; _next = 34; return true; } @@ -12399,6 +12564,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x400000000L) != 0) { _current = new KeyValuePair(HeaderNames.AccessControlExposeHeaders, _collection._headers._AccessControlExposeHeaders); + _currentKnownType = KnownHeaderType.AccessControlExposeHeaders; _next = 35; return true; } @@ -12406,6 +12572,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x800000000L) != 0) { _current = new KeyValuePair(HeaderNames.AccessControlMaxAge, _collection._headers._AccessControlMaxAge); + _currentKnownType = KnownHeaderType.AccessControlMaxAge; _next = 36; return true; } @@ -12413,6 +12580,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (_collection._contentLength.HasValue) { _current = new KeyValuePair(HeaderNames.ContentLength, HeaderUtilities.FormatNonNegativeInt64(_collection._contentLength.Value)); + _currentKnownType = KnownHeaderType.ContentLength; _next = 37; return true; } @@ -12420,9 +12588,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (!_hasUnknown || !_unknownEnumerator.MoveNext()) { _current = default(KeyValuePair); + _currentKnownType = default; return false; } _current = _unknownEnumerator.Current; + _currentKnownType = KnownHeaderType.Unknown; return true; } } @@ -12668,6 +12838,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if ((_bits & 0x1L) != 0) { _current = new KeyValuePair(HeaderNames.ETag, _collection._headers._ETag); + _currentKnownType = KnownHeaderType.ETag; _next = 1; return true; } @@ -12676,9 +12847,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http if (!_hasUnknown || !_unknownEnumerator.MoveNext()) { _current = default(KeyValuePair); + _currentKnownType = default; return false; } _current = _unknownEnumerator.Current; + _currentKnownType = KnownHeaderType.Unknown; return true; } } diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/HttpRequestHeaders.cs b/src/Servers/Kestrel/Core/src/Internal/Http/HttpRequestHeaders.cs index f22588078c..a5e78a4442 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpRequestHeaders.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpRequestHeaders.cs @@ -127,6 +127,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http private readonly long _bits; private int _next; private KeyValuePair _current; + private KnownHeaderType _currentKnownType; private readonly bool _hasUnknown; private Dictionary.Enumerator _unknownEnumerator; @@ -136,6 +137,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http _bits = collection._bits; _next = 0; _current = default; + _currentKnownType = default; _hasUnknown = collection.MaybeUnknown != null; _unknownEnumerator = _hasUnknown ? collection.MaybeUnknown.GetEnumerator() @@ -144,6 +146,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http public KeyValuePair Current => _current; + internal KnownHeaderType CurrentKnownType => _currentKnownType; + object IEnumerator.Current => _current; public void Dispose() diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseHeaders.cs b/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseHeaders.cs index f2100b0cd8..e2ae921259 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseHeaders.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseHeaders.cs @@ -94,6 +94,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http private readonly long _bits; private int _next; private KeyValuePair _current; + private KnownHeaderType _currentKnownType; private readonly bool _hasUnknown; private Dictionary.Enumerator _unknownEnumerator; @@ -103,6 +104,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http _bits = collection._bits; _next = 0; _current = default; + _currentKnownType = default; _hasUnknown = collection.MaybeUnknown != null; _unknownEnumerator = _hasUnknown ? collection.MaybeUnknown.GetEnumerator() @@ -111,6 +113,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http public KeyValuePair Current => _current; + internal KnownHeaderType CurrentKnownType => _currentKnownType; + object IEnumerator.Current => _current; public void Dispose() diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseTrailers.cs b/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseTrailers.cs index ec4144cc83..6bae47c690 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseTrailers.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpResponseTrailers.cs @@ -43,6 +43,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http private readonly long _bits; private int _next; private KeyValuePair _current; + private KnownHeaderType _currentKnownType; private readonly bool _hasUnknown; private Dictionary.Enumerator _unknownEnumerator; @@ -52,6 +53,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http _bits = collection._bits; _next = 0; _current = default; + _currentKnownType = default; _hasUnknown = collection.MaybeUnknown != null; _unknownEnumerator = _hasUnknown ? collection.MaybeUnknown.GetEnumerator() @@ -60,6 +62,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http public KeyValuePair Current => _current; + internal KnownHeaderType CurrentKnownType => _currentKnownType; + object IEnumerator.Current => _current; public void Dispose() diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/HPackHeaderWriter.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/HPackHeaderWriter.cs new file mode 100644 index 0000000000..1598a18c7f --- /dev/null +++ b/src/Servers/Kestrel/Core/src/Internal/Http2/HPackHeaderWriter.cs @@ -0,0 +1,157 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Net.Http; +using System.Net.Http.HPack; +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; + +namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 +{ + internal static class HPackHeaderWriter + { + /// + /// Begin encoding headers in the first HEADERS frame. + /// + public static bool BeginEncodeHeaders(int statusCode, Http2HeadersEnumerator headersEnumerator, Span buffer, out int length) + { + if (!HPackEncoder.EncodeStatusHeader(statusCode, buffer, out var statusCodeLength)) + { + throw new HPackEncodingException(SR.net_http_hpack_encode_failure); + } + + if (!headersEnumerator.MoveNext()) + { + length = statusCodeLength; + return true; + } + + // We're ok with not throwing if no headers were encoded because we've already encoded the status. + // There is a small chance that the header will encode if there is no other content in the next HEADERS frame. + var done = EncodeHeaders(headersEnumerator, buffer.Slice(statusCodeLength), throwIfNoneEncoded: false, out var headersLength); + length = statusCodeLength + headersLength; + + return done; + } + + /// + /// Begin encoding headers in the first HEADERS frame. + /// + public static bool BeginEncodeHeaders(Http2HeadersEnumerator headersEnumerator, Span buffer, out int length) + { + if (!headersEnumerator.MoveNext()) + { + length = 0; + return true; + } + + return EncodeHeaders(headersEnumerator, buffer, throwIfNoneEncoded: true, out length); + } + + /// + /// Continue encoding headers in the next HEADERS frame. The enumerator should already have a current value. + /// + public static bool ContinueEncodeHeaders(Http2HeadersEnumerator headersEnumerator, Span buffer, out int length) + { + return EncodeHeaders(headersEnumerator, buffer, throwIfNoneEncoded: true, out length); + } + + private static bool EncodeHeaders(Http2HeadersEnumerator headersEnumerator, Span buffer, bool throwIfNoneEncoded, out int length) + { + var currentLength = 0; + do + { + if (!EncodeHeader(headersEnumerator.KnownHeaderType, headersEnumerator.Current.Key, headersEnumerator.Current.Value, buffer.Slice(currentLength), out int headerLength)) + { + // The the header wasn't written and no headers have been written then the header is too large. + // Throw an error to avoid an infinite loop of attempting to write large header. + if (currentLength == 0 && throwIfNoneEncoded) + { + throw new HPackEncodingException(SR.net_http_hpack_encode_failure); + } + + length = currentLength; + return false; + } + + currentLength += headerLength; + } + while (headersEnumerator.MoveNext()); + + length = currentLength; + + return true; + } + + private static bool EncodeHeader(KnownHeaderType knownHeaderType, string name, string value, Span buffer, out int length) + { + var hPackStaticTableId = GetResponseHeaderStaticTableId(knownHeaderType); + + if (hPackStaticTableId == -1) + { + return HPackEncoder.EncodeLiteralHeaderFieldWithoutIndexingNewName(name, value, buffer, out length); + } + else + { + return HPackEncoder.EncodeLiteralHeaderFieldWithoutIndexing(hPackStaticTableId, value, buffer, out length); + } + } + + private static int GetResponseHeaderStaticTableId(KnownHeaderType responseHeaderType) + { + switch (responseHeaderType) + { + case KnownHeaderType.CacheControl: + return H2StaticTable.CacheControl; + case KnownHeaderType.Date: + return H2StaticTable.Date; + case KnownHeaderType.TransferEncoding: + return H2StaticTable.TransferEncoding; + case KnownHeaderType.Via: + return H2StaticTable.Via; + case KnownHeaderType.Allow: + return H2StaticTable.Allow; + case KnownHeaderType.ContentType: + return H2StaticTable.ContentType; + case KnownHeaderType.ContentEncoding: + return H2StaticTable.ContentEncoding; + case KnownHeaderType.ContentLanguage: + return H2StaticTable.ContentLanguage; + case KnownHeaderType.ContentLocation: + return H2StaticTable.ContentLocation; + case KnownHeaderType.ContentRange: + return H2StaticTable.ContentRange; + case KnownHeaderType.Expires: + return H2StaticTable.Expires; + case KnownHeaderType.LastModified: + return H2StaticTable.LastModified; + case KnownHeaderType.AcceptRanges: + return H2StaticTable.AcceptRanges; + case KnownHeaderType.Age: + return H2StaticTable.Age; + case KnownHeaderType.ETag: + return H2StaticTable.ETag; + case KnownHeaderType.Location: + return H2StaticTable.Location; + case KnownHeaderType.ProxyAuthenticate: + return H2StaticTable.ProxyAuthenticate; + case KnownHeaderType.RetryAfter: + return H2StaticTable.RetryAfter; + case KnownHeaderType.Server: + return H2StaticTable.Server; + case KnownHeaderType.SetCookie: + return H2StaticTable.SetCookie; + case KnownHeaderType.Vary: + return H2StaticTable.Vary; + case KnownHeaderType.WWWAuthenticate: + return H2StaticTable.WwwAuthenticate; + case KnownHeaderType.AccessControlAllowOrigin: + return H2StaticTable.AccessControlAllowOrigin; + case KnownHeaderType.ContentLength: + return H2StaticTable.ContentLength; + default: + return -1; + } + } + } +} diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2FrameWriter.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2FrameWriter.cs index 8336fdf23b..2d50e71d5f 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2FrameWriter.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2FrameWriter.cs @@ -7,6 +7,7 @@ using System.Buffers.Binary; using System.Collections.Generic; using System.Diagnostics; using System.IO.Pipelines; +using System.Net.Http; using System.Net.Http.HPack; using System.Threading; using System.Threading.Tasks; @@ -27,7 +28,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 private readonly object _writeLock = new object(); private readonly Http2Frame _outgoingFrame; - private readonly HPackEncoder _hpackEncoder = new HPackEncoder(); private readonly Http2HeadersEnumerator _headersEnumerator = new Http2HeadersEnumerator(); private readonly ConcurrentPipeWriter _outputWriter; private readonly ConnectionContext _connectionContext; @@ -175,7 +175,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 _headersEnumerator.Initialize(headers); _outgoingFrame.PrepareHeaders(headerFrameFlags, streamId); var buffer = _headerEncodingBuffer.AsSpan(); - var done = _hpackEncoder.BeginEncode(statusCode, _headersEnumerator, buffer, out var payloadLength); + var done = HPackHeaderWriter.BeginEncodeHeaders(statusCode, _headersEnumerator, buffer, out var payloadLength); FinishWritingHeaders(streamId, payloadLength, done); } catch (HPackEncodingException hex) @@ -201,7 +201,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 _headersEnumerator.Initialize(headers); _outgoingFrame.PrepareHeaders(Http2HeadersFrameFlags.END_STREAM, streamId); var buffer = _headerEncodingBuffer.AsSpan(); - var done = _hpackEncoder.BeginEncode(_headersEnumerator, buffer, out var payloadLength); + var done = HPackHeaderWriter.BeginEncodeHeaders(_headersEnumerator, buffer, out var payloadLength); FinishWritingHeaders(streamId, payloadLength, done); } catch (HPackEncodingException hex) @@ -230,7 +230,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 { _outgoingFrame.PrepareContinuation(Http2ContinuationFrameFlags.NONE, streamId); - done = _hpackEncoder.Encode(buffer, out payloadLength); + done = HPackHeaderWriter.ContinueEncodeHeaders(_headersEnumerator, buffer, out payloadLength); _outgoingFrame.PayloadLength = payloadLength; if (done) diff --git a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2HeaderEnumerator.cs b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2HeaderEnumerator.cs index bd5ec3c449..421650b9fd 100644 --- a/src/Servers/Kestrel/Core/src/Internal/Http2/Http2HeaderEnumerator.cs +++ b/src/Servers/Kestrel/Core/src/Internal/Http2/Http2HeaderEnumerator.cs @@ -16,6 +16,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 private IEnumerator> _genericEnumerator; private StringValues.Enumerator _stringValuesEnumerator; + public KnownHeaderType KnownHeaderType { get; private set; } public KeyValuePair Current { get; private set; } object IEnumerator.Current => Current; @@ -32,6 +33,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 _stringValuesEnumerator = default; Current = default; + KnownHeaderType = default; } public void Initialize(HttpResponseTrailers headers) @@ -43,6 +45,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 _stringValuesEnumerator = default; Current = default; + KnownHeaderType = default; } public void Initialize(IDictionary headers) @@ -54,6 +57,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 _stringValuesEnumerator = default; Current = default; + KnownHeaderType = default; } public bool MoveNext() @@ -106,6 +110,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 else { enumerator = _genericEnumerator.Current.Value.GetEnumerator(); + KnownHeaderType = default; return true; } } @@ -119,6 +124,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 else { enumerator = _trailersEnumerator.Current.Value.GetEnumerator(); + KnownHeaderType = _trailersEnumerator.CurrentKnownType; return true; } } @@ -132,6 +138,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 else { enumerator = _headersEnumerator.Current.Value.GetEnumerator(); + KnownHeaderType = _headersEnumerator.CurrentKnownType; return true; } } @@ -152,6 +159,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 _headersEnumerator.Reset(); } _stringValuesEnumerator = default; + KnownHeaderType = default; } public void Dispose() diff --git a/src/Servers/Kestrel/Core/test/HPackEncoderTests.cs b/src/Servers/Kestrel/Core/test/HPackHeaderWriterTests.cs similarity index 89% rename from src/Servers/Kestrel/Core/test/HPackEncoderTests.cs rename to src/Servers/Kestrel/Core/test/HPackHeaderWriterTests.cs index c755292753..3b290d712b 100644 --- a/src/Servers/Kestrel/Core/test/HPackEncoderTests.cs +++ b/src/Servers/Kestrel/Core/test/HPackHeaderWriterTests.cs @@ -3,17 +3,14 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; -using System.Net.Http.HPack; -using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2; using Microsoft.Extensions.Primitives; using Xunit; namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests { - public class HPackEncoderTests + public class HPackHeaderWriterTests { public static TheoryData[], byte[], int?> SinglePayloadData { @@ -94,16 +91,15 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests [MemberData(nameof(SinglePayloadData))] public void EncodesHeadersInSinglePayloadWhenSpaceAvailable(KeyValuePair[] headers, byte[] expectedPayload, int? statusCode) { - var encoder = new HPackEncoder(); var payload = new byte[1024]; var length = 0; if (statusCode.HasValue) { - Assert.True(encoder.BeginEncode(statusCode.Value, GetHeadersEnumerator(headers), payload, out length)); + Assert.True(HPackHeaderWriter.BeginEncodeHeaders(statusCode.Value, GetHeadersEnumerator(headers), payload, out length)); } else { - Assert.True(encoder.BeginEncode(GetHeadersEnumerator(headers), payload, out length)); + Assert.True(HPackHeaderWriter.BeginEncodeHeaders(GetHeadersEnumerator(headers), payload, out length)); } Assert.Equal(expectedPayload.Length, length); @@ -120,10 +116,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests [InlineData(false)] public void EncodesHeadersInMultiplePayloadsWhenSpaceNotAvailable(bool exactSize) { - var encoder = new HPackEncoder(); - var statusCode = 200; - var headers = new [] + var headers = new[] { new KeyValuePair("date", "Mon, 24 Jul 2017 19:22:30 GMT"), new KeyValuePair("content-type", "text/html; charset=utf-8"), @@ -161,31 +155,32 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests Span payload = new byte[1024]; var offset = 0; + var headerEnumerator = GetHeadersEnumerator(headers); // When !exactSize, slices are one byte short of fitting the next header var sliceLength = expectedStatusCodePayload.Length + (exactSize ? 0 : expectedDateHeaderPayload.Length - 1); - Assert.False(encoder.BeginEncode(statusCode, GetHeadersEnumerator(headers), payload.Slice(offset, sliceLength), out var length)); + Assert.False(HPackHeaderWriter.BeginEncodeHeaders(statusCode, headerEnumerator, payload.Slice(offset, sliceLength), out var length)); Assert.Equal(expectedStatusCodePayload.Length, length); Assert.Equal(expectedStatusCodePayload, payload.Slice(0, length).ToArray()); offset += length; sliceLength = expectedDateHeaderPayload.Length + (exactSize ? 0 : expectedContentTypeHeaderPayload.Length - 1); - Assert.False(encoder.Encode(payload.Slice(offset, sliceLength), out length)); + Assert.False(HPackHeaderWriter.ContinueEncodeHeaders(headerEnumerator, payload.Slice(offset, sliceLength), out length)); Assert.Equal(expectedDateHeaderPayload.Length, length); Assert.Equal(expectedDateHeaderPayload, payload.Slice(offset, length).ToArray()); offset += length; sliceLength = expectedContentTypeHeaderPayload.Length + (exactSize ? 0 : expectedServerHeaderPayload.Length - 1); - Assert.False(encoder.Encode(payload.Slice(offset, sliceLength), out length)); + Assert.False(HPackHeaderWriter.ContinueEncodeHeaders(headerEnumerator, payload.Slice(offset, sliceLength), out length)); Assert.Equal(expectedContentTypeHeaderPayload.Length, length); Assert.Equal(expectedContentTypeHeaderPayload, payload.Slice(offset, length).ToArray()); offset += length; sliceLength = expectedServerHeaderPayload.Length; - Assert.True(encoder.Encode(payload.Slice(offset, sliceLength), out length)); + Assert.True(HPackHeaderWriter.ContinueEncodeHeaders(headerEnumerator, payload.Slice(offset, sliceLength), out length)); Assert.Equal(expectedServerHeaderPayload.Length, length); Assert.Equal(expectedServerHeaderPayload, payload.Slice(offset, length).ToArray()); } diff --git a/src/Servers/Kestrel/perf/Kestrel.Performance/Http2ConnectionBenchmark.cs b/src/Servers/Kestrel/perf/Kestrel.Performance/Http2ConnectionBenchmark.cs index 1438fb5379..3018f4a346 100644 --- a/src/Servers/Kestrel/perf/Kestrel.Performance/Http2ConnectionBenchmark.cs +++ b/src/Servers/Kestrel/perf/Kestrel.Performance/Http2ConnectionBenchmark.cs @@ -30,7 +30,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance private Http2Connection _connection; private Http2HeadersEnumerator _requestHeadersEnumerator; private int _currentStreamId; - private HPackEncoder _hpackEncoder; private byte[] _headersBuffer; [GlobalSetup] @@ -47,7 +46,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance _httpRequestHeaders.Append(HeaderNames.Scheme, new StringValues("http")); _httpRequestHeaders.Append(HeaderNames.Authority, new StringValues("localhost:80")); - _hpackEncoder = new HPackEncoder(); _headersBuffer = new byte[1024 * 16]; var serviceContext = new ServiceContext @@ -78,7 +76,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance _ = _connection.ProcessRequestsAsync(new DummyApplication()); _pipe.Writer.Write(Http2Connection.ClientPreface); - PipeWriterHttp2FrameExtensions.WriteSettings(_pipe.Writer, new Http2PeerSettings()); + _pipe.Writer.WriteSettings(new Http2PeerSettings()); _pipe.Writer.FlushAsync().GetAwaiter().GetResult(); } @@ -86,7 +84,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance public async Task EmptyRequest() { _requestHeadersEnumerator.Initialize(_httpRequestHeaders); - PipeWriterHttp2FrameExtensions.WriteStartStream(_pipe.Writer, streamId: _currentStreamId, _requestHeadersEnumerator, _hpackEncoder, _headersBuffer, endStream: true); + _requestHeadersEnumerator.MoveNext(); + _pipe.Writer.WriteStartStream(streamId: _currentStreamId, _requestHeadersEnumerator, _headersBuffer, endStream: true); _currentStreamId += 2; await _pipe.Writer.FlushAsync(); } diff --git a/src/Servers/Kestrel/shared/KnownHeaders.cs b/src/Servers/Kestrel/shared/KnownHeaders.cs index ec81326e68..e6389a675e 100644 --- a/src/Servers/Kestrel/shared/KnownHeaders.cs +++ b/src/Servers/Kestrel/shared/KnownHeaders.cs @@ -562,6 +562,9 @@ namespace CodeGenerator var responseTrailers = ResponseTrailers; + var allHeaderNames = RequestHeaders.Concat(ResponseHeaders).Concat(ResponseTrailers) + .Select(h => h.Identifier).Distinct().OrderBy(n => n).ToArray(); + var loops = new[] { new @@ -612,6 +615,11 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http {{ + internal enum KnownHeaderType + {{ + Unknown,{Each(allHeaderNames, n => @" + " + n + ",")} + }} {Each(loops, loop => $@" internal partial class {loop.ClassName} {{{(loop.Bytes != null ? @@ -1058,6 +1066,7 @@ $@" private void Clear(long bitsToClear) if ({header.TestBit()}) {{ _current = new KeyValuePair(HeaderNames.{header.Identifier}, _collection._headers._{header.Identifier}); + _currentKnownType = KnownHeaderType.{header.Identifier}; _next = {header.Index + 1}; return true; }}")} @@ -1065,6 +1074,7 @@ $@" private void Clear(long bitsToClear) if (_collection._contentLength.HasValue) {{ _current = new KeyValuePair(HeaderNames.ContentLength, HeaderUtilities.FormatNonNegativeInt64(_collection._contentLength.Value)); + _currentKnownType = KnownHeaderType.ContentLength; _next = {loop.Headers.Count()}; return true; }}" : "")} @@ -1072,9 +1082,11 @@ $@" private void Clear(long bitsToClear) if (!_hasUnknown || !_unknownEnumerator.MoveNext()) {{ _current = default(KeyValuePair); + _currentKnownType = default; return false; }} _current = _unknownEnumerator.Current; + _currentKnownType = KnownHeaderType.Unknown; return true; }} }} diff --git a/src/Servers/Kestrel/shared/test/PipeWriterHttp2FrameExtensions.cs b/src/Servers/Kestrel/shared/test/PipeWriterHttp2FrameExtensions.cs index beb76e1c55..daf333e703 100644 --- a/src/Servers/Kestrel/shared/test/PipeWriterHttp2FrameExtensions.cs +++ b/src/Servers/Kestrel/shared/test/PipeWriterHttp2FrameExtensions.cs @@ -24,13 +24,13 @@ namespace Microsoft.AspNetCore.Testing writer.Write(payload); } - public static void WriteStartStream(this PipeWriter writer, int streamId, Http2HeadersEnumerator headers, HPackEncoder hpackEncoder, byte[] headerEncodingBuffer, bool endStream) + public static void WriteStartStream(this PipeWriter writer, int streamId, Http2HeadersEnumerator headers, byte[] headerEncodingBuffer, bool endStream) { var frame = new Http2Frame(); frame.PrepareHeaders(Http2HeadersFrameFlags.NONE, streamId); var buffer = headerEncodingBuffer.AsSpan(); - var done = hpackEncoder.BeginEncode(headers, buffer, out var length); + var done = HPackHeaderWriter.BeginEncodeHeaders(headers, buffer, out var length); frame.PayloadLength = length; if (done) @@ -50,7 +50,7 @@ namespace Microsoft.AspNetCore.Testing { frame.PrepareContinuation(Http2ContinuationFrameFlags.NONE, streamId); - done = hpackEncoder.Encode(buffer, out length); + done = HPackHeaderWriter.ContinueEncodeHeaders(headers, buffer, out length); frame.PayloadLength = length; if (done) @@ -63,6 +63,22 @@ namespace Microsoft.AspNetCore.Testing } } + public static void WriteStartStream(this PipeWriter writer, int streamId, Span headerData, bool endStream) + { + var frame = new Http2Frame(); + frame.PrepareHeaders(Http2HeadersFrameFlags.NONE, streamId); + frame.PayloadLength = headerData.Length; + frame.HeadersFlags = Http2HeadersFrameFlags.END_HEADERS; + + if (endStream) + { + frame.HeadersFlags |= Http2HeadersFrameFlags.END_STREAM; + } + + Http2FrameWriter.WriteHeader(frame, writer); + writer.Write(headerData); + } + public static void WriteData(this PipeWriter writer, int streamId, Memory data, bool endStream) { var frame = new Http2Frame(); diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs index 7d93bdce3a..310398d00e 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs @@ -42,7 +42,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, requestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -61,7 +61,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(3, requestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 3); @@ -82,7 +82,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -112,7 +112,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloBytes, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -127,7 +127,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(3, _helloBytes, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); await ExpectAsync(Http2FrameType.DATA, @@ -171,7 +171,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests appDelegateTcs.TrySetResult(null); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -194,7 +194,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests appDelegateTcs.TrySetResult(null); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 3); @@ -304,7 +304,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[length], endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); // The client's settings is still defaulted to Http2PeerSettings.MinAllowedMaxFrameSize so the echo response will come back in two separate frames @@ -333,7 +333,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloWorldBytes, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -359,7 +359,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _maxData, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -402,7 +402,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests } await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -523,7 +523,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _noData, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -551,7 +551,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloBytes, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var stream1DataFrame1 = await ExpectAsync(Http2FrameType.DATA, @@ -562,7 +562,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(3, _helloBytes, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); var stream3DataFrame1 = await ExpectAsync(Http2FrameType.DATA, @@ -631,7 +631,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests } await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -683,7 +683,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests withStreamId: 0); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); @@ -761,7 +761,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests stream3ReadFinished.TrySetResult(null); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); await ExpectAsync(Http2FrameType.DATA, @@ -776,7 +776,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests stream1ReadFinished.TrySetResult(null); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -803,7 +803,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataWithPaddingAsync(1, _helloWorldBytes, padLength, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -848,7 +848,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests } await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -907,7 +907,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests } await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -976,7 +976,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _maxData, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -1151,7 +1151,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _postRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1193,7 +1193,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(3, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 3); @@ -1243,7 +1243,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(3, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 3); @@ -1347,7 +1347,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -1368,7 +1368,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(3, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 3); @@ -1402,7 +1402,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1417,7 +1417,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1437,7 +1437,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersWithPaddingAsync(1, _browserRequestHeaders, padLength, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1454,7 +1454,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersWithPriorityAsync(1, _browserRequestHeaders, priority: 42, streamDependency: 0, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1474,7 +1474,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersWithPaddingAndPriorityAsync(1, _browserRequestHeaders, padLength, priority: 42, streamDependency: 0, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1500,7 +1500,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // The second stream should end first, since the first one is waiting for the request body. await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 3); @@ -1512,7 +1512,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersAsync(1, Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM, _requestTrailers); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1546,7 +1546,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloBytes, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -1596,14 +1596,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests finishSecondRequest.TrySetResult(null); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 3); finishFirstRequest.TrySetResult(null); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1629,7 +1629,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests requestBlocker.SetResult(0); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1672,7 +1672,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1715,7 +1715,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(3, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 3); @@ -1939,7 +1939,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersAsync(1, Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM, headers); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -2084,7 +2084,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersAsync(1, Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM, headers); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -2222,7 +2222,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -2247,7 +2247,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // The headers, but not the data for stream 3, can be sent prior to any window updates. await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); @@ -2331,7 +2331,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(streamId, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: streamId); @@ -2811,7 +2811,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests _connection.ServerSettings.MaxFrameSize = Http2PeerSettings.MaxAllowedMaxFrameSize; // This includes the default response headers such as :status, etc - var defaultResponseHeaderLength = 37; + var defaultResponseHeaderLength = 33; var headerValueLength = Http2PeerSettings.MinAllowedMaxFrameSize; // First byte is always 0 // Second byte is the length of header name which is 1 @@ -2881,7 +2881,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -3030,7 +3030,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloBytes, true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -3043,7 +3043,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests withStreamId: 1); await SendDataAsync(3, _helloBytes, true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); await ExpectAsync(Http2FrameType.DATA, @@ -3116,7 +3116,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -3139,13 +3139,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // The headers, but not the data for the stream, can still be sent. await StartStreamAsync(3, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); await StartStreamAsync(5, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 5); @@ -3209,7 +3209,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(streamId, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: streamId); @@ -3442,7 +3442,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -3499,7 +3499,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloWorldBytes, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -3538,7 +3538,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloWorldBytes, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -3590,7 +3590,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _twoContinuationsRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -3616,7 +3616,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // The second stream should end first, since the first one is waiting for the request body. await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 3); @@ -3639,7 +3639,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendContinuationAsync(1, Http2ContinuationFrameFlags.END_HEADERS, trailers); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -3661,8 +3661,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests { await InitializeConnectionAsync(_readHeadersApplication); - await SendHeadersAsync(1, Http2HeadersFrameFlags.NONE, _oneContinuationRequestHeaders); - await SendContinuationAsync(3, Http2ContinuationFrameFlags.END_HEADERS); + var headersEnumerator = GetHeadersEnumerator(_oneContinuationRequestHeaders); + await SendHeadersAsync(1, Http2HeadersFrameFlags.NONE, headersEnumerator); + await SendContinuationAsync(3, Http2ContinuationFrameFlags.END_HEADERS, headersEnumerator); await WaitForConnectionErrorAsync( ignoreNonGoAwayFrames: false, @@ -3736,7 +3737,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendEmptyContinuationFrameAsync(1, Http2ContinuationFrameFlags.END_HEADERS); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -3751,7 +3752,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 12361, + withLength: 12343, withFlags: (byte)Http2HeadersFrameFlags.END_STREAM, withStreamId: 1); var continuationFrame1 = await ExpectAsync(Http2FrameType.CONTINUATION, @@ -3910,7 +3911,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -3960,7 +3961,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloBytes, true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -3994,7 +3995,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloBytes, true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -4007,7 +4008,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests withStreamId: 1); await SendDataAsync(3, _helloBytes, true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); await ExpectAsync(Http2FrameType.DATA, @@ -4097,7 +4098,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2StreamTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2StreamTests.cs index 6d9e6da62e..a59207ccda 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2StreamTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2StreamTests.cs @@ -79,7 +79,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 70, + withLength: 52, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -104,7 +104,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersAsync(1, Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM, headers); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 71, + withLength: 53, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -131,7 +131,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersAsync(1, Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM, headers); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 75, + withLength: 57, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -159,7 +159,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersAsync(1, Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM, headers); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 76, + withLength: 58, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -193,7 +193,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersAsync(1, Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM, headers); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 118, + withLength: 100, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -235,7 +235,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendHeadersAsync(1, Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM, headers); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -297,7 +297,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -326,7 +326,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -355,7 +355,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 65, + withLength: 47, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -386,7 +386,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 65, + withLength: 47, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -417,7 +417,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 65, + withLength: 47, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -448,7 +448,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 65, + withLength: 47, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -570,7 +570,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[12], endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -611,7 +611,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[12], endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -655,7 +655,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[8], endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -698,7 +698,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[8], endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -751,7 +751,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[8], endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -983,7 +983,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[12], endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1015,7 +1015,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 56, + withLength: 38, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.RST_STREAM, @@ -1054,7 +1054,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 56, + withLength: 38, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -1092,7 +1092,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1125,7 +1125,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -1160,7 +1160,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -1198,7 +1198,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -1236,7 +1236,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -1276,7 +1276,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -1323,7 +1323,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -1361,7 +1361,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -1397,7 +1397,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -1441,7 +1441,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 56, + withLength: 38, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -1475,7 +1475,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -1508,7 +1508,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 56, + withLength: 38, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -1552,7 +1552,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[12], endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1591,7 +1591,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: false); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 59, + withLength: 41, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1634,7 +1634,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[12], endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1674,7 +1674,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[6], endStream: false); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 59, + withLength: 41, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1733,7 +1733,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[6], endStream: false); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 59, + withLength: 41, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1788,7 +1788,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, new byte[12], endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -1814,7 +1814,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -1852,7 +1852,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_STREAM | Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); @@ -1883,7 +1883,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); var headersFrame1 = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var trailersFrame1 = await ExpectAsync(Http2FrameType.HEADERS, @@ -1894,7 +1894,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(3, _browserRequestHeaders, endStream: true); var headersFrame2 = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 3); @@ -1930,7 +1930,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -1980,7 +1980,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -2039,7 +2039,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -2074,7 +2074,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -2124,7 +2124,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true).DefaultTimeout(); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1).DefaultTimeout(); @@ -2189,7 +2189,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -2235,7 +2235,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -2269,7 +2269,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -2532,7 +2532,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -2623,7 +2623,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, _browserRequestHeaders, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -2671,7 +2671,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // Just the StatusCode gets written before aborting in the continuation frame await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.NONE, withStreamId: 1); @@ -2700,7 +2700,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -2743,7 +2743,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -2789,7 +2789,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -2835,7 +2835,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -2884,7 +2884,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -2937,7 +2937,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -2987,7 +2987,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -3037,7 +3037,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -3080,7 +3080,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -3126,7 +3126,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); var dataFrame = await ExpectAsync(Http2FrameType.DATA, @@ -3168,7 +3168,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -3213,7 +3213,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -3279,7 +3279,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 56, + withLength: 38, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -3325,7 +3325,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 56, + withLength: 38, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -3361,7 +3361,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 56, + withLength: 38, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -3413,7 +3413,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 56, + withLength: 38, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -3465,7 +3465,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -3498,7 +3498,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests // Don't receive content length because we called WriteAsync which caused an invalid response var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS | (byte)Http2HeadersFrameFlags.END_STREAM, withStreamId: 1); @@ -3531,7 +3531,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -3583,7 +3583,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -3639,7 +3639,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var trailersFrame = await ExpectAsync(Http2FrameType.HEADERS, @@ -3705,7 +3705,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -3761,7 +3761,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var bodyFrame = await ExpectAsync(Http2FrameType.DATA, @@ -3826,7 +3826,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -3885,7 +3885,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var bodyFrame = await ExpectAsync(Http2FrameType.DATA, @@ -3941,7 +3941,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -4003,7 +4003,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var bodyFrame = await ExpectAsync(Http2FrameType.DATA, @@ -4077,7 +4077,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var bodyFrame = await ExpectAsync(Http2FrameType.DATA, @@ -4153,7 +4153,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 56, + withLength: 38, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var bodyFrame = await ExpectAsync(Http2FrameType.DATA, @@ -4224,7 +4224,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 56, + withLength: 38, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var bodyFrame = await ExpectAsync(Http2FrameType.DATA, @@ -4296,7 +4296,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var bodyFrame = await ExpectAsync(Http2FrameType.DATA, @@ -4380,7 +4380,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: false); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var bodyFrame = await ExpectAsync(Http2FrameType.DATA, @@ -4461,7 +4461,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var bodyFrame = await ExpectAsync(Http2FrameType.DATA, @@ -4548,7 +4548,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StartStreamAsync(1, headers, endStream: false); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS), withStreamId: 1); var bodyFrame = await ExpectAsync(Http2FrameType.DATA, @@ -4583,30 +4583,32 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests Assert.Equal("Custom Value", _decodedHeaders["CustomName"]); } + // :method = GET + // :path = / + // :scheme = http + // X-Test = £ + private static readonly byte[] LatinHeaderData = new byte[] + { + 0, 7, 58, 109, 101, 116, 104, 111, 100, 3, 71, 69, 84, 0, 5, 58, 112, 97, 116, + 104, 1, 47, 0, 7, 58, 115, 99, 104, 101, 109, 101, 4, 104, 116, 116, 112, 0, + 6, 120, 45, 116, 101, 115, 116, 1, 163 + }; + [Fact] public async Task HEADERS_Received_Latin1_AcceptedWhenLatin1OptionIsConfigured() { _serviceContext.ServerOptions.Latin1RequestHeaders = true; - var headers = new[] - { - new KeyValuePair(HeaderNames.Method, "GET"), - new KeyValuePair(HeaderNames.Path, "/"), - new KeyValuePair(HeaderNames.Scheme, "http"), - // The HPackEncoder will encode £ as 0xA3 aka Latin1 encoding. - new KeyValuePair("X-Test", "£"), - }; - await InitializeConnectionAsync(context => { Assert.Equal("£", context.Request.Headers["X-Test"]); return Task.CompletedTask; }); - await StartStreamAsync(1, headers, endStream: true); + await StartStreamAsync(1, LatinHeaderData, endStream: true); var headersFrame = await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -4623,18 +4625,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests [Fact] public async Task HEADERS_Received_Latin1_RejectedWhenLatin1OptionIsNotConfigured() { - var headers = new[] - { - new KeyValuePair(HeaderNames.Method, "GET"), - new KeyValuePair(HeaderNames.Path, "/"), - new KeyValuePair(HeaderNames.Scheme, "http"), - // The HPackEncoder will encode £ as 0xA3 aka Latin1 encoding. - new KeyValuePair("X-Test", "£"), - }; - await InitializeConnectionAsync(_noopApplication); - await StartStreamAsync(1, headers, endStream: true); + await StartStreamAsync(1, LatinHeaderData, endStream: true); await WaitForConnectionErrorAsync( ignoreNonGoAwayFrames: true, diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TestBase.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TestBase.cs index 68076af39c..9277372a79 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TestBase.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TestBase.cs @@ -119,7 +119,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests private readonly MemoryPool _memoryPool = SlabMemoryPoolFactory.Create(); internal readonly Http2PeerSettings _clientSettings = new Http2PeerSettings(); - internal readonly HPackEncoder _hpackEncoder = new HPackEncoder(); internal readonly HPackDecoder _hpackDecoder; private readonly byte[] _headerEncodingBuffer = new byte[Http2PeerSettings.MinAllowedMaxFrameSize]; @@ -501,7 +500,17 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); _runningStreams[streamId] = tcs; - PipeWriterHttp2FrameExtensions.WriteStartStream(writableBuffer, streamId, GetHeadersEnumerator(headers), _hpackEncoder, _headerEncodingBuffer, endStream); + writableBuffer.WriteStartStream(streamId, GetHeadersEnumerator(headers), _headerEncodingBuffer, endStream); + return FlushAsync(writableBuffer); + } + + protected Task StartStreamAsync(int streamId, Span headerData, bool endStream) + { + var writableBuffer = _pair.Application.Output; + var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + _runningStreams[streamId] = tcs; + + writableBuffer.WriteStartStream(streamId, headerData, endStream); return FlushAsync(writableBuffer); } @@ -531,7 +540,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests extendedHeader[0] = padLength; var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); - _hpackEncoder.BeginEncode(GetHeadersEnumerator(headers), payload, out var length); + HPackHeaderWriter.BeginEncodeHeaders(GetHeadersEnumerator(headers), payload, out var length); var padding = buffer.Slice(extendedHeaderLength + length, padLength); padding.Fill(0); @@ -574,7 +583,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests extendedHeader[4] = priority; var payload = buffer.Slice(extendedHeaderLength); - _hpackEncoder.BeginEncode(GetHeadersEnumerator(headers), payload, out var length); + HPackHeaderWriter.BeginEncodeHeaders(GetHeadersEnumerator(headers), payload, out var length); frame.PayloadLength = extendedHeaderLength + length; @@ -621,7 +630,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests extendedHeader[5] = priority; var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); - _hpackEncoder.BeginEncode(GetHeadersEnumerator(headers), payload, out var length); + HPackHeaderWriter.BeginEncodeHeaders(GetHeadersEnumerator(headers), payload, out var length); var padding = buffer.Slice(extendedHeaderLength + length, padLength); padding.Fill(0); @@ -658,7 +667,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests protected async Task SendSettingsAsync() { - PipeWriterHttp2FrameExtensions.WriteSettings(_pair.Application.Output, _clientSettings); + _pair.Application.Output.WriteSettings(_clientSettings); await FlushAsync(_pair.Application.Output); } @@ -728,14 +737,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests return FlushAsync(writableBuffer); } - internal async Task SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, IEnumerable> headers) + internal async Task SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, Http2HeadersEnumerator headersEnumerator) { var outputWriter = _pair.Application.Output; var frame = new Http2Frame(); frame.PrepareHeaders(flags, streamId); var buffer = _headerEncodingBuffer.AsMemory(); - var done = _hpackEncoder.BeginEncode(GetHeadersEnumerator(headers), buffer.Span, out var length); + var done = HPackHeaderWriter.BeginEncodeHeaders(headersEnumerator, buffer.Span, out var length); frame.PayloadLength = length; Http2FrameWriter.WriteHeader(frame, outputWriter); @@ -744,6 +753,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests return done; } + internal Task SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, IEnumerable> headers) + { + return SendHeadersAsync(streamId, flags, GetHeadersEnumerator(headers)); + } + internal async Task SendHeadersAsync(int streamId, Http2HeadersFrameFlags flags, byte[] headerBlock) { var outputWriter = _pair.Application.Output; @@ -793,14 +807,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendAsync(payload); } - internal async Task SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags) + internal async Task SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, Http2HeadersEnumerator headersEnumerator) { var outputWriter = _pair.Application.Output; var frame = new Http2Frame(); frame.PrepareContinuation(flags, streamId); var buffer = _headerEncodingBuffer.AsMemory(); - var done = _hpackEncoder.Encode(buffer.Span, out var length); + var done = HPackHeaderWriter.ContinueEncodeHeaders(headersEnumerator, buffer.Span, out var length); frame.PayloadLength = length; Http2FrameWriter.WriteHeader(frame, outputWriter); @@ -828,7 +842,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests frame.PrepareContinuation(flags, streamId); var buffer = _headerEncodingBuffer.AsMemory(); - var done = _hpackEncoder.BeginEncode(GetHeadersEnumerator(headers), buffer.Span, out var length); + var done = HPackHeaderWriter.BeginEncodeHeaders(GetHeadersEnumerator(headers), buffer.Span, out var length); frame.PayloadLength = length; Http2FrameWriter.WriteHeader(frame, outputWriter); @@ -837,7 +851,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests return done; } - private Http2HeadersEnumerator GetHeadersEnumerator(IEnumerable> headers) + internal Http2HeadersEnumerator GetHeadersEnumerator(IEnumerable> headers) { var dictionary = headers .GroupBy(g => g.Key) @@ -881,7 +895,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests protected Task SendDataAsync(int streamId, Memory data, bool endStream) { var outputWriter = _pair.Application.Output; - PipeWriterHttp2FrameExtensions.WriteData(outputWriter, streamId, data, endStream); + outputWriter.WriteData(streamId, data, endStream); return FlushAsync(outputWriter); } diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TimeoutTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TimeoutTests.cs index 5ae038fed1..02413c5805 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TimeoutTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TimeoutTests.cs @@ -101,7 +101,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests _mockTimeoutControl.Verify(c => c.SetTimeout(It.IsAny(), TimeoutReason.RequestHeaders), Times.Once); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); @@ -283,7 +283,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloWorldBytes, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -336,7 +336,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _maxData, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -390,7 +390,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloWorldBytes, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -444,7 +444,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _maxData, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -500,7 +500,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _maxData, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); await ExpectAsync(Http2FrameType.DATA, @@ -512,7 +512,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(3, _maxData, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); await ExpectAsync(Http2FrameType.DATA, @@ -566,7 +566,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloWorldBytes, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -615,7 +615,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _maxData, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -668,7 +668,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _maxData, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -681,7 +681,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(3, _maxData, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); await ExpectAsync(Http2FrameType.DATA, @@ -737,7 +737,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _maxData, endStream: true); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -755,7 +755,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(3, _maxData, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); await ExpectAsync(Http2FrameType.DATA, @@ -812,7 +812,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(1, _helloWorldBytes, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 1); @@ -884,7 +884,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await SendDataAsync(3, _helloWorldBytes, endStream: false); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 37, + withLength: 33, withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, withStreamId: 3); await ExpectAsync(Http2FrameType.DATA, @@ -901,7 +901,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests backpressureTcs.SetResult(null); await ExpectAsync(Http2FrameType.HEADERS, - withLength: 55, + withLength: 37, withFlags: (byte)(Http2HeadersFrameFlags.END_HEADERS | Http2HeadersFrameFlags.END_STREAM), withStreamId: 1); diff --git a/src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs b/src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs index add7c0e2fd..9f3c3598bc 100644 --- a/src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs +++ b/src/Servers/Kestrel/test/Interop.FunctionalTests/HttpClientHttp2InteropTests.cs @@ -1118,7 +1118,7 @@ namespace Interop.FunctionalTests Assert.Equal(oneKbString + i, response.Headers.GetValues("header" + i).Single()); } - Assert.Single(TestSink.Writes.Where(context => context.Message.Contains("sending HEADERS frame for stream ID 1 with length 15636 and flags END_STREAM"))); + Assert.Single(TestSink.Writes.Where(context => context.Message.Contains("sending HEADERS frame for stream ID 1 with length 15612 and flags END_STREAM"))); Assert.Equal(2, TestSink.Writes.Where(context => context.Message.Contains("sending CONTINUATION frame for stream ID 1 with length 15585 and flags NONE")).Count()); Assert.Single(TestSink.Writes.Where(context => context.Message.Contains("sending CONTINUATION frame for stream ID 1 with length 14546 and flags END_HEADERS"))); diff --git a/src/Shared/Http2cat/HPackHeaderWriter.cs b/src/Shared/Http2cat/HPackHeaderWriter.cs new file mode 100644 index 0000000000..27772caa72 --- /dev/null +++ b/src/Shared/Http2cat/HPackHeaderWriter.cs @@ -0,0 +1,91 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Net.Http.HPack; + +namespace Microsoft.AspNetCore.Http2Cat +{ + internal static class HPackHeaderWriter + { + /// + /// Begin encoding headers in the first HEADERS frame. + /// + public static bool BeginEncodeHeaders(int statusCode, IEnumerator> headersEnumerator, Span buffer, out int length) + { + if (!HPackEncoder.EncodeStatusHeader(statusCode, buffer, out var statusCodeLength)) + { + throw new HPackEncodingException(SR.net_http_hpack_encode_failure); + } + + if (!headersEnumerator.MoveNext()) + { + length = statusCodeLength; + return true; + } + + // We're ok with not throwing if no headers were encoded because we've already encoded the status. + // There is a small chance that the header will encode if there is no other content in the next HEADERS frame. + var done = EncodeHeaders(headersEnumerator, buffer.Slice(statusCodeLength), throwIfNoneEncoded: false, out var headersLength); + length = statusCodeLength + headersLength; + + return done; + } + + /// + /// Begin encoding headers in the first HEADERS frame. + /// + public static bool BeginEncodeHeaders(IEnumerator> headersEnumerator, Span buffer, out int length) + { + if (!headersEnumerator.MoveNext()) + { + length = 0; + return true; + } + + return EncodeHeaders(headersEnumerator, buffer, throwIfNoneEncoded: true, out length); + } + + /// + /// Continue encoding headers in the next HEADERS frame. The enumerator should already have a current value. + /// + public static bool ContinueEncodeHeaders(IEnumerator> headersEnumerator, Span buffer, out int length) + { + return EncodeHeaders(headersEnumerator, buffer, throwIfNoneEncoded: true, out length); + } + + private static bool EncodeHeaders(IEnumerator> headersEnumerator, Span buffer, bool throwIfNoneEncoded, out int length) + { + var currentLength = 0; + do + { + if (!EncodeHeader(headersEnumerator.Current.Key, headersEnumerator.Current.Value, buffer.Slice(currentLength), out int headerLength)) + { + // The the header wasn't written and no headers have been written then the header is too large. + // Throw an error to avoid an infinite loop of attempting to write large header. + if (currentLength == 0 && throwIfNoneEncoded) + { + throw new HPackEncodingException(SR.net_http_hpack_encode_failure); + } + + length = currentLength; + return false; + } + + currentLength += headerLength; + } + while (headersEnumerator.MoveNext()); + + length = currentLength; + + return true; + } + + private static bool EncodeHeader(string name, string value, Span buffer, out int length) + { + return HPackEncoder.EncodeLiteralHeaderFieldWithoutIndexingNewName(name, value, buffer, out length); + } + } +} diff --git a/src/Shared/Http2cat/Http2Utilities.cs b/src/Shared/Http2cat/Http2Utilities.cs index b4a0fd367c..13a6ba4fc5 100644 --- a/src/Shared/Http2cat/Http2Utilities.cs +++ b/src/Shared/Http2cat/Http2Utilities.cs @@ -122,7 +122,6 @@ namespace Microsoft.AspNetCore.Http2Cat public static readonly byte[] _maxData = Encoding.ASCII.GetBytes(new string('a', Http2PeerSettings.MinAllowedMaxFrameSize)); internal readonly Http2PeerSettings _clientSettings = new Http2PeerSettings(); - internal readonly HPackEncoder _hpackEncoder = new HPackEncoder(); internal readonly HPackDecoder _hpackDecoder; private readonly byte[] _headerEncodingBuffer = new byte[Http2PeerSettings.MinAllowedMaxFrameSize]; @@ -236,7 +235,8 @@ namespace Microsoft.AspNetCore.Http2Cat frame.PrepareHeaders(Http2HeadersFrameFlags.NONE, streamId); var buffer = _headerEncodingBuffer.AsSpan(); - var done = _hpackEncoder.BeginEncode(headers.GetEnumerator(), buffer, out var length); + var headersEnumerator = GetHeadersEnumerator(headers); + var done = HPackHeaderWriter.BeginEncodeHeaders(headersEnumerator, buffer, out var length); frame.PayloadLength = length; if (done) @@ -256,7 +256,7 @@ namespace Microsoft.AspNetCore.Http2Cat { frame.PrepareContinuation(Http2ContinuationFrameFlags.NONE, streamId); - done = _hpackEncoder.Encode(buffer, out length); + done = HPackHeaderWriter.ContinueEncodeHeaders(headersEnumerator, buffer, out length); frame.PayloadLength = length; if (done) @@ -271,6 +271,12 @@ namespace Microsoft.AspNetCore.Http2Cat return FlushAsync(writableBuffer); } + private static IEnumerator> GetHeadersEnumerator(IEnumerable> headers) + { + var headersEnumerator = headers.GetEnumerator(); + return headersEnumerator; + } + internal Dictionary DecodeHeaders(Http2FrameWithPayload frame, bool endHeaders = false) { Assert.Equal(Http2FrameType.HEADERS, frame.Type); @@ -335,7 +341,7 @@ namespace Microsoft.AspNetCore.Http2Cat extendedHeader[0] = padLength; var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); - _hpackEncoder.BeginEncode(headers.GetEnumerator(), payload, out var length); + HPackHeaderWriter.BeginEncodeHeaders(GetHeadersEnumerator(headers), payload, out var length); var padding = buffer.Slice(extendedHeaderLength + length, padLength); padding.Fill(0); @@ -377,7 +383,7 @@ namespace Microsoft.AspNetCore.Http2Cat extendedHeader[4] = priority; var payload = buffer.Slice(extendedHeaderLength); - _hpackEncoder.BeginEncode(headers.GetEnumerator(), payload, out var length); + HPackHeaderWriter.BeginEncodeHeaders(GetHeadersEnumerator(headers), payload, out var length); frame.PayloadLength = extendedHeaderLength + length; @@ -423,7 +429,7 @@ namespace Microsoft.AspNetCore.Http2Cat extendedHeader[5] = priority; var payload = buffer.Slice(extendedHeaderLength, buffer.Length - padLength - extendedHeaderLength); - _hpackEncoder.BeginEncode(headers.GetEnumerator(), payload, out var length); + HPackHeaderWriter.BeginEncodeHeaders(GetHeadersEnumerator(headers), payload, out var length); var padding = buffer.Slice(extendedHeaderLength + length, padLength); padding.Fill(0); @@ -549,7 +555,7 @@ namespace Microsoft.AspNetCore.Http2Cat frame.PrepareHeaders(flags, streamId); var buffer = _headerEncodingBuffer.AsMemory(); - var done = _hpackEncoder.BeginEncode(headers.GetEnumerator(), buffer.Span, out var length); + var done = HPackHeaderWriter.BeginEncodeHeaders(GetHeadersEnumerator(headers), buffer.Span, out var length); frame.PayloadLength = length; WriteHeader(frame, outputWriter); @@ -607,14 +613,14 @@ namespace Microsoft.AspNetCore.Http2Cat await SendAsync(payload); } - internal async Task SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags) + internal async Task SendContinuationAsync(int streamId, Http2ContinuationFrameFlags flags, IEnumerator> headersEnumerator) { var outputWriter = _pair.Application.Output; var frame = new Http2Frame(); frame.PrepareContinuation(flags, streamId); var buffer = _headerEncodingBuffer.AsMemory(); - var done = _hpackEncoder.Encode(buffer.Span, out var length); + var done = HPackHeaderWriter.ContinueEncodeHeaders(headersEnumerator, buffer.Span, out var length); frame.PayloadLength = length; WriteHeader(frame, outputWriter); @@ -642,7 +648,7 @@ namespace Microsoft.AspNetCore.Http2Cat frame.PrepareContinuation(flags, streamId); var buffer = _headerEncodingBuffer.AsMemory(); - var done = _hpackEncoder.BeginEncode(headers.GetEnumerator(), buffer.Span, out var length); + var done = HPackHeaderWriter.BeginEncodeHeaders(GetHeadersEnumerator(headers), buffer.Span, out var length); frame.PayloadLength = length; WriteHeader(frame, outputWriter); diff --git a/src/Shared/runtime/Http2/Hpack/H2StaticTable.cs b/src/Shared/runtime/Http2/Hpack/H2StaticTable.cs index 52de5ee8a8..7f3b775582 100644 --- a/src/Shared/runtime/Http2/Hpack/H2StaticTable.cs +++ b/src/Shared/runtime/Http2/Hpack/H2StaticTable.cs @@ -108,6 +108,7 @@ namespace System.Net.Http.HPack public const int PathSlash = 4; public const int SchemeHttp = 6; public const int SchemeHttps = 7; + public const int Status200 = 8; public const int AcceptCharset = 15; public const int AcceptEncoding = 16; public const int AcceptLanguage = 17; diff --git a/src/Shared/runtime/Http2/Hpack/HPackEncoder.cs b/src/Shared/runtime/Http2/Hpack/HPackEncoder.cs index ac321b6f0d..15aec6cfa6 100644 --- a/src/Shared/runtime/Http2/Hpack/HPackEncoder.cs +++ b/src/Shared/runtime/Http2/Hpack/HPackEncoder.cs @@ -3,172 +3,11 @@ // See the LICENSE file in the project root for more information. using System.Diagnostics; -#if KESTREL -using HeadersEnumerator = Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2HeadersEnumerator; -#else -using HeadersEnumerator = System.Collections.Generic.IEnumerator>; -#endif namespace System.Net.Http.HPack { - internal class HPackEncoder + internal static class HPackEncoder { - private HeadersEnumerator _enumerator; - - public bool BeginEncode(HeadersEnumerator enumerator, Span buffer, out int length) - { - _enumerator = enumerator; - _enumerator.MoveNext(); - - return Encode(buffer, out length); - } - - public bool BeginEncode(int statusCode, HeadersEnumerator enumerator, Span buffer, out int length) - { - _enumerator = enumerator; - _enumerator.MoveNext(); - - int statusCodeLength = EncodeStatusCode(statusCode, buffer); - bool done = Encode(buffer.Slice(statusCodeLength), throwIfNoneEncoded: false, out int headersLength); - length = statusCodeLength + headersLength; - - return done; - } - - public bool Encode(Span buffer, out int length) - { - return Encode(buffer, throwIfNoneEncoded: true, out length); - } - - private bool Encode(Span buffer, bool throwIfNoneEncoded, out int length) - { - int currentLength = 0; - do - { - if (!EncodeHeader(_enumerator.Current.Key, _enumerator.Current.Value, buffer.Slice(currentLength), out int headerLength)) - { - if (currentLength == 0 && throwIfNoneEncoded) - { - throw new HPackEncodingException(SR.net_http_hpack_encode_failure); - } - - length = currentLength; - return false; - } - - currentLength += headerLength; - } - while (_enumerator.MoveNext()); - - length = currentLength; - - return true; - } - - private int EncodeStatusCode(int statusCode, Span buffer) - { - switch (statusCode) - { - // Status codes which exist in the HTTP/2 StaticTable. - case 200: - case 204: - case 206: - case 304: - case 400: - case 404: - case 500: - buffer[0] = (byte)(0x80 | H2StaticTable.StatusIndex[statusCode]); - return 1; - default: - // Send as Literal Header Field Without Indexing - Indexed Name - buffer[0] = 0x08; - - ReadOnlySpan statusBytes = StatusCodes.ToStatusBytes(statusCode); - buffer[1] = (byte)statusBytes.Length; - statusBytes.CopyTo(buffer.Slice(2)); - - return 2 + statusBytes.Length; - } - } - - private bool EncodeHeader(string name, string value, Span buffer, out int length) - { - int i = 0; - length = 0; - - if (buffer.Length == 0) - { - return false; - } - - buffer[i++] = 0; - - if (i == buffer.Length) - { - return false; - } - - if (!EncodeString(name, buffer.Slice(i), out int nameLength, lowercase: true)) - { - return false; - } - - i += nameLength; - - if (i >= buffer.Length) - { - return false; - } - - if (!EncodeString(value, buffer.Slice(i), out int valueLength, lowercase: false)) - { - return false; - } - - i += valueLength; - - length = i; - return true; - } - - private bool EncodeString(string value, Span destination, out int bytesWritten, bool lowercase) - { - // From https://tools.ietf.org/html/rfc7541#section-5.2 - // ------------------------------------------------------ - // 0 1 2 3 4 5 6 7 - // +---+---+---+---+---+---+---+---+ - // | H | String Length (7+) | - // +---+---------------------------+ - // | String Data (Length octets) | - // +-------------------------------+ - const int toLowerMask = 0x20; - - if (destination.Length != 0) - { - destination[0] = 0; // TODO: Use Huffman encoding - if (IntegerEncoder.Encode(value.Length, 7, destination, out int integerLength)) - { - Debug.Assert(integerLength >= 1); - - destination = destination.Slice(integerLength); - if (value.Length <= destination.Length) - { - for (int i = 0; i < value.Length; i++) - { - char c = value[i]; - destination[i] = (byte)(lowercase && (uint)(c - 'A') <= ('Z' - 'A') ? c | toLowerMask : c); - } - - bytesWritten = integerLength + value.Length; - return true; - } - } - } - - bytesWritten = 0; - return false; - } - // Things we should add: // * Huffman encoding // @@ -199,6 +38,43 @@ namespace System.Net.Http.HPack return false; } + /// Encodes the status code of a response to the :status field. + public static bool EncodeStatusHeader(int statusCode, Span destination, out int bytesWritten) + { + // Bytes written depend on whether the status code value maps directly to an index + switch (statusCode) + { + case 200: + case 204: + case 206: + case 304: + case 400: + case 404: + case 500: + // Status codes which exist in the HTTP/2 StaticTable. + return EncodeIndexedHeaderField(H2StaticTable.StatusIndex[statusCode], destination, out bytesWritten); + default: + // If the status code doesn't have a static index then we need to include the full value. + // Write a status index and then the number bytes as a string literal. + if (!EncodeLiteralHeaderFieldWithoutIndexing(H2StaticTable.Status200, destination, out var nameLength)) + { + bytesWritten = 0; + return false; + } + + var statusBytes = StatusCodes.ToStatusBytes(statusCode); + + if (!EncodeStringLiteral(statusBytes, destination.Slice(nameLength), out var valueLength)) + { + bytesWritten = 0; + return false; + } + + bytesWritten = nameLength + valueLength; + return true; + } + } + /// Encodes a "Literal Header Field without Indexing". public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, string value, Span destination, out int bytesWritten) { @@ -233,7 +109,7 @@ namespace System.Net.Http.HPack /// /// Encodes a "Literal Header Field without Indexing", but only the index portion; - /// a subsequent call to must be used to encode the associated value. + /// a subsequent call to EncodeStringLiteral must be used to encode the associated value. /// public static bool EncodeLiteralHeaderFieldWithoutIndexing(int index, Span destination, out int bytesWritten) { @@ -266,6 +142,39 @@ namespace System.Net.Http.HPack return false; } + /// Encodes a "Literal Header Field without Indexing - New Name". + public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, string value, Span destination, out int bytesWritten) + { + // From https://tools.ietf.org/html/rfc7541#section-6.2.2 + // ------------------------------------------------------ + // 0 1 2 3 4 5 6 7 + // +---+---+---+---+---+---+---+---+ + // | 0 | 0 | 0 | 0 | 0 | + // +---+---+-----------------------+ + // | H | Name Length (7+) | + // +---+---------------------------+ + // | Name String (Length octets) | + // +---+---------------------------+ + // | H | Value Length (7+) | + // +---+---------------------------+ + // | Value String (Length octets) | + // +-------------------------------+ + + if ((uint)destination.Length >= 3) + { + destination[0] = 0; + if (EncodeLiteralHeaderName(name, destination.Slice(1), out int nameLength) && + EncodeStringLiteral(value, destination.Slice(1 + nameLength), out int valueLength)) + { + bytesWritten = 1 + nameLength + valueLength; + return true; + } + } + + bytesWritten = 0; + return false; + } + /// Encodes a "Literal Header Field without Indexing - New Name". public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, ReadOnlySpan values, string separator, Span destination, out int bytesWritten) { @@ -301,7 +210,7 @@ namespace System.Net.Http.HPack /// /// Encodes a "Literal Header Field without Indexing - New Name", but only the name portion; - /// a subsequent call to must be used to encode the associated value. + /// a subsequent call to EncodeStringLiteral must be used to encode the associated value. /// public static bool EncodeLiteralHeaderFieldWithoutIndexingNewName(string name, Span destination, out int bytesWritten) { @@ -397,6 +306,40 @@ namespace System.Net.Http.HPack return false; } + public static bool EncodeStringLiteral(ReadOnlySpan value, Span destination, out int bytesWritten) + { + // From https://tools.ietf.org/html/rfc7541#section-5.2 + // ------------------------------------------------------ + // 0 1 2 3 4 5 6 7 + // +---+---+---+---+---+---+---+---+ + // | H | String Length (7+) | + // +---+---------------------------+ + // | String Data (Length octets) | + // +-------------------------------+ + + if (destination.Length != 0) + { + destination[0] = 0; // TODO: Use Huffman encoding + if (IntegerEncoder.Encode(value.Length, 7, destination, out int integerLength)) + { + Debug.Assert(integerLength >= 1); + + destination = destination.Slice(integerLength); + if (value.Length <= destination.Length) + { + // Note: No validation. Bytes should have already been validated. + value.CopyTo(destination); + + bytesWritten = integerLength + value.Length; + return true; + } + } + } + + bytesWritten = 0; + return false; + } + public static bool EncodeStringLiteral(string value, Span destination, out int bytesWritten) { // From https://tools.ietf.org/html/rfc7541#section-5.2 @@ -485,7 +428,7 @@ namespace System.Net.Http.HPack /// /// Encodes a "Literal Header Field without Indexing" to a new array, but only the index portion; - /// a subsequent call to must be used to encode the associated value. + /// a subsequent call to EncodeStringLiteral must be used to encode the associated value. /// public static byte[] EncodeLiteralHeaderFieldWithoutIndexingToAllocatedArray(int index) { @@ -497,7 +440,7 @@ namespace System.Net.Http.HPack /// /// Encodes a "Literal Header Field without Indexing - New Name" to a new array, but only the name portion; - /// a subsequent call to must be used to encode the associated value. + /// a subsequent call to EncodeStringLiteral must be used to encode the associated value. /// public static byte[] EncodeLiteralHeaderFieldWithoutIndexingNewNameToAllocatedArray(string name) {