Skip to content

Commit d431d6a

Browse files
authored
H/3 stress (#55098)
* Fixed event source name * Updated docker files, updated stress test to H/3 * SSL stress updated as well * Fixed docker and compilation warnings * H/3 fixes * Fixed nano-server version and nuget reference * Debian stable version revert: bullseye --> buster * Use msquic package in Linux stress container * Bullseye is back, needs 6.0 SDK current preview * Fixed pulling images in docker compose * Disabled problematic error in H/2
1 parent ede3733 commit d431d6a

File tree

18 files changed

+88
-24
lines changed

18 files changed

+88
-24
lines changed

eng/docker/libraries-sdk-aspnetcore.linux.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Builds and copies library artifacts into target dotnet sdk image
22
ARG BUILD_BASE_IMAGE=mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-f39df28-20191023143754
3-
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:5.0-buster-slim
3+
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:6.0-bullseye-slim
44

55
FROM $BUILD_BASE_IMAGE as corefxbuild
66

eng/docker/libraries-sdk-aspnetcore.windows.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# escape=`
22
# Simple Dockerfile which copies library build artifacts into target dotnet sdk image
3-
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:5.0-nanoserver-1809
3+
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:6.0-nanoserver-1809
44
FROM $SDK_BASE_IMAGE as target
55

66
ARG TESTHOST_LOCATION=".\\artifacts\\bin\\testhost"

eng/docker/libraries-sdk.linux.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Builds and copies library artifacts into target dotnet sdk image
22
ARG BUILD_BASE_IMAGE=mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-f39df28-20191023143754
3-
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:5.0-buster-slim
3+
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:6.0-bullseye-slim
44

55
FROM $BUILD_BASE_IMAGE as corefxbuild
66

eng/docker/libraries-sdk.windows.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# escape=`
22
# Simple Dockerfile which copies clr and library build artifacts into target dotnet sdk image
3-
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:5.0-nanoserver-1809
3+
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:6.0-nanoserver-1809
44
FROM $SDK_BASE_IMAGE as target
55

66
ARG TESTHOST_LOCATION=".\\artifacts\\bin\\testhost"

eng/pipelines/libraries/stress/http.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ variables:
2525
jobs:
2626
- job: linux
2727
displayName: Docker Linux
28-
timeoutInMinutes: 150
28+
timeoutInMinutes: 180
2929
pool:
3030
name: NetCorePublic-Pool
3131
queue: BuildPool.Ubuntu.1804.Amd64.Open
@@ -47,6 +47,14 @@ jobs:
4747
name: buildStress
4848
displayName: Build HttpStress
4949
50+
- bash: |
51+
cd '$(httpStressProject)'
52+
export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 3.0"
53+
export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 3.0"
54+
docker-compose up --abort-on-container-exit --no-color
55+
displayName: Run HttpStress - HTTP 3.0
56+
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))
57+
5058
- bash: |
5159
cd '$(httpStressProject)'
5260
export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 2.0"

src/libraries/System.Net.Http/tests/StressTests/HttpStress/ClientOperations.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ public RequestContext(Configuration config, HttpClient httpClient, Random random
4242
public int TaskNum { get; }
4343
public bool IsCancellationRequested { get; private set; }
4444

45-
public Version HttpVersion => _config.HttpVersion;
45+
public Version HttpVersion => _client.DefaultRequestVersion;
46+
public HttpVersionPolicy VersionPolicy => _client.DefaultVersionPolicy;
4647
public int MaxRequestParameters => _config.MaxParameters;
4748
public int MaxRequestUriSize => _config.MaxRequestUriSize;
4849
public int MaxRequestHeaderCount => _config.MaxRequestHeaderCount;
@@ -54,6 +55,7 @@ public RequestContext(Configuration config, HttpClient httpClient, Random random
5455
public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, HttpCompletionOption httpCompletion = HttpCompletionOption.ResponseContentRead, CancellationToken? token = null)
5556
{
5657
request.Version = HttpVersion;
58+
request.VersionPolicy = VersionPolicy;
5759

5860
if (token != null)
5961
{
@@ -480,6 +482,12 @@ public static (string name, Func<RequestContext, Task> operation)[] Operations =
480482

481483
private static void ValidateStatusCode(HttpResponseMessage m, HttpStatusCode expectedStatus = HttpStatusCode.OK)
482484
{
485+
// [ActiveIssue("https://github.com/dotnet/runtime/issues/55261")]
486+
if (m.StatusCode == HttpStatusCode.InternalServerError)
487+
{
488+
throw new Exception("IGNORE");
489+
}
490+
483491
if (m.StatusCode != expectedStatus)
484492
{
485493
throw new Exception($"Expected status code {expectedStatus}, got {m.StatusCode}");

src/libraries/System.Net.Http/tests/StressTests/HttpStress/Dockerfile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:5.0-buster-slim
1+
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:6.0-bullseye-slim
22
FROM $SDK_BASE_IMAGE
33

44
RUN echo "DOTNET_SDK_VERSION="$DOTNET_SDK_VERSION
@@ -7,6 +7,18 @@ RUN echo "DOTNET_VERSION="$DOTNET_VERSION
77
WORKDIR /app
88
COPY . .
99

10+
# Pulling the msquic Debian package from msquic-ci public pipeline and from a hardcoded build.
11+
# Note that this is a temporary solution until we have properly published Linux packages.
12+
# Also note that in order to update to a newer msquic build, you have update this link.
13+
ARG MSQUIC_PACKAGE=libmsquic_1.5.0_amd64.deb
14+
ARG PACKAGES_DIR=LinuxPackages
15+
RUN wget 'https://dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_apis/build/builds/1223883/artifacts?artifactName=LinuxPackages&api-version=6.0&%24format=zip' -O "$PACKAGES_DIR".zip
16+
RUN apt-get update
17+
RUN apt-get install unzip
18+
RUN unzip $PACKAGES_DIR.zip
19+
RUN dpkg -i $PACKAGES_DIR/$MSQUIC_PACKAGE
20+
RUN rm -rf $PACKAGES_DIR*
21+
1022
ARG CONFIGURATION=Release
1123
RUN dotnet build -c $CONFIGURATION
1224

src/libraries/System.Net.Http/tests/StressTests/HttpStress/HttpStress.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net5.0</TargetFramework>
5+
<TargetFramework>net6.0</TargetFramework>
66
<LangVersion>preview</LangVersion>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>
@@ -13,6 +13,7 @@
1313
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
1414
<PackageReference Include="System.CommandLine.Experimental" Version="0.3.0-alpha.19577.1" />
1515
<PackageReference Include="System.Net.Http.WinHttpHandler" Version="4.5.4" />
16+
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Transport.Quic" Version="6.0.0-preview.5.21301.17"/>
1617
</ItemGroup>
1718

1819
</Project>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<!-- Add public nuget feed. -->
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
6+
</packageSources>
7+
</configuration>

src/libraries/System.Net.Http/tests/StressTests/HttpStress/Program.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@
99
using System.Diagnostics.CodeAnalysis;
1010
using System.Linq;
1111
using System.Reflection;
12+
using System.Runtime.Versioning;
1213
using System.Threading.Tasks;
1314
using System.Net;
1415
using HttpStress;
1516

17+
[assembly:SupportedOSPlatform("windows")]
18+
[assembly:SupportedOSPlatform("linux")]
19+
1620
/// <summary>
1721
/// Simple HttpClient stress app that launches Kestrel in-proc and runs many concurrent requests of varying types against it.
1822
/// </summary>

0 commit comments

Comments
 (0)