Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stress test sandboxing #57653

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a61eea9
try publishing artifacts
antonfirsov Aug 18, 2021
7213925
.
antonfirsov Aug 18, 2021
2a438f2
.
antonfirsov Aug 18, 2021
c5a07c3
f* yaml
antonfirsov Aug 18, 2021
66aaa25
:'''''(
antonfirsov Aug 18, 2021
99aadf1
add dummy ReportFile
antonfirsov Aug 19, 2021
8898002
Merge branch 'main' into sandbox/http-stress-artifacts
antonfirsov Aug 19, 2021
587ae8f
save report file before printing
antonfirsov Aug 19, 2021
a2a8194
mount volume
antonfirsov Aug 31, 2021
07e2383
try to publish reports from stress runs
antonfirsov Aug 31, 2021
9a01f73
GetFailureFingerprint
antonfirsov Sep 1, 2021
89d93a8
ExportFailures
antonfirsov Sep 1, 2021
1351c57
export some failures
antonfirsov Sep 1, 2021
63a857d
Merge branch 'sandbox/http-stress-artifacts' of https:/an…
antonfirsov Sep 1, 2021
e5788fe
do not save report if output not defined
antonfirsov Sep 1, 2021
df3f921
test actual report in yml
antonfirsov Sep 1, 2021
1a7768d
Merge branch 'main' into sandbox/http-stress-artifacts
antonfirsov Sep 1, 2021
b125046
using System.IO
antonfirsov Sep 2, 2021
c61b3c8
condition: always() for artifacts
antonfirsov Sep 15, 2021
09d1729
fix artifact publish
antonfirsov Sep 15, 2021
12c4e08
disable windows entirely for now
antonfirsov Sep 15, 2021
36736b7
FailureReport -> StressRunReport
antonfirsov Sep 15, 2021
ca51a8c
add HttpStress.ReportAnalyzer skeleton
antonfirsov Sep 15, 2021
a8896ca
basic ReportAggregator functionality
antonfirsov Sep 15, 2021
fcbc439
aggregate failures by timestamps
antonfirsov Sep 16, 2021
396af82
try appending the type name
antonfirsov Sep 16, 2021
4c56e97
looong-looong haaaash
antonfirsov Sep 20, 2021
91d95c8
Exclude ClientOperations.cs stuff from failure fingerprints.
antonfirsov Sep 20, 2021
f2b4c6b
EnablePreviewFeatures
antonfirsov Sep 21, 2021
28e09b0
Merge branch 'main' into sandbox/http-stress-artifacts
antonfirsov Sep 22, 2021
275a6e3
more permissive callsite matching
antonfirsov Sep 23, 2021
e484f09
Merge branch 'main' into sandbox/http-stress-artifacts
antonfirsov Sep 23, 2021
5d0b645
woop
antonfirsov Sep 23, 2021
01869dd
woooop
antonfirsov Sep 23, 2021
02cb12c
try to fix artifact creation
antonfirsov Sep 24, 2021
7fad42a
yeah
antonfirsov Sep 24, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
180 changes: 94 additions & 86 deletions eng/pipelines/libraries/stress/http.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
timeoutInMinutes: 180
variables:
DUMPS_SHARE_MOUNT_ROOT: "/dumps-share"
REPORTS_SHARE_MOUNT_ROOT: "/reports-share"
pool:
name: NetCorePublic-Pool
queue: BuildPool.Ubuntu.1804.Amd64.Open
Expand All @@ -54,99 +55,106 @@ jobs:
cd '$(httpStressProject)'
export CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/3.0"
export SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/3.0"
export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 3.0 -xops 10"
export REPORTS_SHARE="$(Build.ArtifactStagingDirectory)/reports"

export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 3.0 -xops 10 -reportFile /reports-share/linux-http30.xml"
export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 3.0"
docker-compose up --abort-on-container-exit --no-color
displayName: Run HttpStress - HTTP 3.0
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))

- bash: |
cd '$(httpStressProject)'
export CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/2.0"
export SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/2.0"
export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 2.0"
export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 2.0"
docker-compose up --abort-on-container-exit --no-color
displayName: Run HttpStress - HTTP 2.0
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))

- bash: |
cd '$(httpStressProject)'
export CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/1.1"
export SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/1.1"
export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 1.1"
export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 1.1"
docker-compose up --abort-on-container-exit --no-color
displayName: Run HttpStress - HTTP 1.1
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))
# - bash: |
# cd '$(httpStressProject)'
# export CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/2.0"
# export SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/2.0"
# export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 2.0"
# export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 2.0"
# docker-compose up --abort-on-container-exit --no-color
# displayName: Run HttpStress - HTTP 2.0
# condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))
#
# - bash: |
# cd '$(httpStressProject)'
# export CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/1.1"
# export SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/1.1"
# export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 1.1"
# export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 1.1"
# docker-compose up --abort-on-container-exit --no-color
# displayName: Run HttpStress - HTTP 1.1
# condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))

- publish: $(Build.ArtifactStagingDirectory)/dumps
artifact: DumpsLinux
condition: failed()

- job: windows
displayName: Docker NanoServer
timeoutInMinutes: 150
variables:
DUMPS_SHARE_MOUNT_ROOT: "C:/dumps-share"
pool:
name: NetCorePublic-Pool
queue: BuildPool.Server.Amd64.VS2019.Open

steps:
- checkout: self
clean: true
fetchDepth: 5
lfs: false

- powershell: |
$(dockerfilesFolder)/build-docker-sdk.ps1 -w -t $(sdkBaseImage) -c $(BUILD_CONFIGURATION)
echo "##vso[task.setvariable variable=succeeded;isOutput=true]true"
name: buildRuntime
displayName: Build CLR and Libraries

- powershell: |
$(httpStressProject)/run-docker-compose.ps1 -w -o -c $(BUILD_CONFIGURATION) -t $(sdkBaseImage)
echo "##vso[task.setvariable variable=succeeded;isOutput=true]true"
name: buildStress
displayName: Build HttpStress

# Firewall is disabled for the test runs, since it can lead to unexpected TCP failures on CI machines, which are unrelated to the HTTP logic.
# See: https:/dotnet/runtime/issues/50854
- powershell: |
Set-NetFirewallProfile -Profile Domain, Public, Private -Enabled False
name: disableFirewall
displayName: Disable Firewall

- powershell: |
cd '$(httpStressProject)'
$env:CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/2.0"
$env:SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/2.0"
New-Item -Force $env:CLIENT_DUMPS_SHARE -ItemType Directory
New-Item -Force $env:SERVER_DUMPS_SHARE -ItemType Directory
$env:HTTPSTRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 2.0"
$env:HTTPSTRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 2.0"
docker-compose up --abort-on-container-exit --no-color
displayName: Run HttpStress - HTTP 2.0
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))

- powershell: |
cd '$(httpStressProject)'
$env:CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/1.1"
$env:SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/1.1"
New-Item -Force $env:CLIENT_DUMPS_SHARE -ItemType Directory
New-Item -Force $env:SERVER_DUMPS_SHARE -ItemType Directory
$env:HTTPSTRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 1.1"
$env:HTTPSTRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 1.1"
docker-compose up --abort-on-container-exit --no-color
displayName: Run HttpStress - HTTP 1.1
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))

- publish: $(Build.ArtifactStagingDirectory)/dumps
artifact: DumpsWindows
condition: failed()

- powershell: |
Set-NetFirewallProfile -Profile Domain, Public, Private -Enabled True
name: enableFirewall
displayName: Enable Firewall
- publish: $(Build.ArtifactStagingDirectory)/reports
artifact: ReportsLinux
condition: always()

#- job: windows
# displayName: Docker NanoServer
# timeoutInMinutes: 150
# variables:
# DUMPS_SHARE_MOUNT_ROOT: "C:/dumps-share"
# pool:
# name: NetCorePublic-Pool
# queue: BuildPool.Server.Amd64.VS2019.Open
#
# steps:
# - checkout: self
# clean: true
# fetchDepth: 5
# lfs: false
#
# - powershell: |
# $(dockerfilesFolder)/build-docker-sdk.ps1 -w -t $(sdkBaseImage) -c $(BUILD_CONFIGURATION)
# echo "##vso[task.setvariable variable=succeeded;isOutput=true]true"
# name: buildRuntime
# displayName: Build CLR and Libraries
#
# - powershell: |
# $(httpStressProject)/run-docker-compose.ps1 -w -o -c $(BUILD_CONFIGURATION) -t $(sdkBaseImage)
# echo "##vso[task.setvariable variable=succeeded;isOutput=true]true"
# name: buildStress
# displayName: Build HttpStress
#
# # Firewall is disabled for the test runs, since it can lead to unexpected TCP failures on CI machines, which are unrelated to the HTTP logic.
# # See: https:/dotnet/runtime/issues/50854
# - powershell: |
# Set-NetFirewallProfile -Profile Domain, Public, Private -Enabled False
# name: disableFirewall
# displayName: Disable Firewall
#
# - powershell: |
# cd '$(httpStressProject)'
# $env:CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/2.0"
# $env:SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/2.0"
# New-Item -Force $env:CLIENT_DUMPS_SHARE -ItemType Directory
# New-Item -Force $env:SERVER_DUMPS_SHARE -ItemType Directory
# $env:HTTPSTRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 2.0"
# $env:HTTPSTRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 2.0"
# docker-compose up --abort-on-container-exit --no-color
# displayName: Run HttpStress - HTTP 2.0
# condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))
#
# - powershell: |
# cd '$(httpStressProject)'
# $env:CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/1.1"
# $env:SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/1.1"
# New-Item -Force $env:CLIENT_DUMPS_SHARE -ItemType Directory
# New-Item -Force $env:SERVER_DUMPS_SHARE -ItemType Directory
# $env:HTTPSTRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 1.1"
# $env:HTTPSTRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 1.1"
# docker-compose up --abort-on-container-exit --no-color
# displayName: Run HttpStress - HTTP 1.1
# condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))
#
# - publish: $(Build.ArtifactStagingDirectory)/dumps
# artifact: DumpsWindows
# condition: failed()
#
# - powershell: |
# Set-NetFirewallProfile -Profile Domain, Public, Private -Enabled True
# name: enableFirewall
# displayName: Enable Firewall
#
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System.CommandLine;
using System.CommandLine.Help;
using System.CommandLine.IO;
using System.CommandLine.Parsing;

namespace HttpStress.ReportAnalyzer
{
internal class CommandLineOptions
{
public bool Test { get; set; }

public static bool TryParse(string[] args, out CommandLineOptions? options)
{
var cmd = new RootCommand();
cmd.AddOption(new Option<bool>("-test", () => false, "Run tests."));

ParseResult? cmdline = cmd.Parse(args);
if (cmdline.Errors.Count > 0)
{
foreach (ParseError error in cmdline.Errors)
{
Console.WriteLine(error);
}
Console.WriteLine();
new HelpBuilder(new SystemConsole()).Write(cmd);
options = null;
return false;
}

options = new CommandLineOptions()
{
Test = cmdline.ValueForOption<bool>("-test")
};
return true;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<Project/>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<Project/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21308.1" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31521.260
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HttpStress.ReportAnalyzer", "HttpStress.ReportAnalyzer.csproj", "{EBC60574-07AB-4799-948F-FD6FCB2D0521}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EBC60574-07AB-4799-948F-FD6FCB2D0521}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EBC60574-07AB-4799-948F-FD6FCB2D0521}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EBC60574-07AB-4799-948F-FD6FCB2D0521}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EBC60574-07AB-4799-948F-FD6FCB2D0521}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CB668552-0027-44BA-9D25-00A854521C9D}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using HttpStress.ReportAnalyzer;

if (CommandLineOptions.TryParse(args, out var options))
{
if (options!.Test)
{
TestRunner.RunAll();
return;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace HttpStress.ReportAnalyzer
{
public class FailureType
{
private List<(DateTime Timestamp, int Count)> _failures = new ();

public string Fingerprint { get; }

public string ErrorText { get; }

public IEnumerable<(DateTime Timestamp, int Count)> Failures => _failures;

public int TotalFailureCount { get; private set; }

public FailureType(string fingerprint, string errorText)
{
Fingerprint = fingerprint;
ErrorText = errorText;
}

internal void RegisterFailures(DateTime timeStemp, int count)
{
_failures.Add((timeStemp, count));
TotalFailureCount += count;
}
}

public class ReportAggregator
{
private Dictionary<string, FailureType> _failureTypes = new();
public ReportAggregator()
{

}

public IEnumerable<FailureType> FailureTypes => _failureTypes.Values;

public void AppendReportXml(XDocument doc)
{
DateTime failureTimeStamp = DateTime.Parse(doc.Root!.Attribute("Timestamp")!.Value, CultureInfo.InvariantCulture);

foreach (XElement failureElement in doc.Descendants("Failure"))
{
string fingerprint = failureElement.Attribute("FailureTypeFingerprint")!.Value;
if (!_failureTypes.TryGetValue(fingerprint, out FailureType? failureType))
{
XCData failureTextNode = (XCData)failureElement.Element("FailureText")!.FirstNode!;
string errorText = failureTextNode.Value;
failureType = new FailureType(fingerprint, errorText);
_failureTypes[fingerprint] = failureType;
}


int failureCount = (int)failureElement.Attribute("FailureCount")!;
failureType.RegisterFailures(failureTimeStamp, failureCount);
}
}
}
}
Loading