-
Notifications
You must be signed in to change notification settings - Fork 50
Aspire-based load testing harness #5830
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
Open
rbev
wants to merge
36
commits into
master
Choose a base branch
from
rhys/load-tool
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
1ee58c4
wip: load testing tool
rbev 7f2f9e0
add aspire apphost to load testing tool
rbev 8808864
reorganise test tool
rbev c4e9d38
change to rabbitmq
rbev a36fbbd
add support for differnt peristers in aspire
rbev 4ba829e
reoganise test UI
rbev 3e7a094
add otel stack
rbev 92ed86e
Get otel comms working properly
rbev c4b36f3
More dashboard changes
rbev c163453
More robust options behavior
rbev 2bda838
better selection of persistence
rbev ca9cb84
switch back to using a real raven
rbev de27043
Expand Grafana dashboard with ServiceControl ingestion panels and lay…
johnsimons 1665078
Tweaks to load tool
rbev 8f50d9b
Obey repo standards
rbev dda782e
Add text to message bodies for FTS consumption
rbev 7ca1d24
remove broken aspire build
rbev d38c720
add retention sweep job
rbev 0814269
Update dashboard
rbev 92129a7
Add error instance scale out support to test harness
rbev 236e89b
Add audit instances
rbev 55fe91a
add heartbeats
rbev 134f907
Unique audit name
rbev a1c626f
Add metrics and attach monitoring correctly
rbev e0db0b6
tweak dashboard
rbev 1aa49ec
Add sql FTS
rbev 9ae34ca
add sql transport support
rbev eae1eb2
correct sqlserver nuget
rbev 81bd6e9
Get history purge task running again, allow configuration of purge wi…
rbev 96d1ce3
Tidy up documentation and link from root README
rbev 0d7d710
Remove uneccessary test tool tester
rbev 91f9355
Correct search endpoints & don't count failures
rbev c07c7d8
Unique exception grouping support
rbev 3ce3bd2
Improve message rate pacing
rbev 8224725
Log failed sends at Warning and surface them in the UI
rbev 7a21853
tidy up transport selection
rbev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| name: Testing Tool CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| - release-* | ||
| paths: | ||
| - 'tools/testing-tool/**' | ||
| - '.github/workflows/testing-tool-ci.yml' | ||
| pull_request: | ||
| paths: | ||
| - 'tools/testing-tool/**' | ||
| - '.github/workflows/testing-tool-ci.yml' | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| DOTNET_NOLOGO: true | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: pwsh | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build solution | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7.0.1 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup .NET SDK | ||
| uses: actions/setup-dotnet@v6.0.0 | ||
| with: | ||
| global-json-file: global.json | ||
|
|
||
| - name: Build | ||
| run: dotnet build tools/testing-tool/TestingTool.slnx --configuration Release | ||
|
|
||
| - name: Build container image | ||
| uses: docker/build-push-action@v7.2.0 | ||
| with: | ||
| context: . | ||
| file: tools/testing-tool/Dockerfile | ||
| push: false | ||
| load: true | ||
| tags: particular/testing-tool:ci |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # Load Testing | ||
|
|
||
| The [ServiceControl Testing Tool](../tools/testing-tool/README.md) is a stateless .NET service that generates error load and real-world failure scenarios against a test ServiceControl instance, to validate error-ingestion performance. It ships with a web UI for manual control, built-in failure scenarios (third-party outage, timeout spike, poison message, and more), and OpenTelemetry telemetry. | ||
|
|
||
| This guide covers getting it up and running quickly. For the full reference — every scenario, API endpoint, configuration setting, container usage, and scaling notes — see the [testing tool README](../tools/testing-tool/README.md). | ||
|
|
||
| ## Quick start: full stack with Aspire | ||
|
|
||
| The Aspire AppHost brings up the whole system in a single command: the ServiceControl platform (Learning transport), the testing tool, and a complete observability stack (OTel Collector, Jaeger, Prometheus, and Grafana with a prebuilt dashboard). | ||
|
|
||
| ```bash | ||
| aspire run tools/testing-tool/TestingTool.AppHost/TestingTool.AppHost.csproj | ||
| ``` | ||
|
|
||
| Aspire assigns dynamic ports — open the testing tool's web UI via the link in the Aspire dashboard. | ||
|
|
||
| Useful flags, passed after `--`: | ||
|
|
||
| | Flag | Description | | ||
| |---|---| | ||
| | `--tag <tag>` | Test a specific ServiceControl image tag, e.g. a PR prerelease like `pr-1234` | | ||
| | `--persistence <type>` | Persistence for the error instance: `RavenDb` (default), `SqlServer`, or `PostgreSql` | | ||
| | `--error-ingestion-scale-unit <n>` | Spin up `n` additional error-ingestion-only ServiceControl instances | | ||
|
|
||
| ## Run against an existing ServiceControl | ||
|
|
||
| ```bash | ||
| dotnet build tools/testing-tool/TestingTool.slnx --configuration Release | ||
| dotnet run --project tools/testing-tool/TestingTool --configuration Release | ||
| ``` | ||
|
|
||
| Open http://localhost:5290. The tool defaults to a ServiceControl instance at `http://localhost:33333`; point it elsewhere with the `TestingTool__ServiceControlApiUrl` environment variable. | ||
|
|
||
| ## Generating load | ||
|
|
||
| Everything is controllable from the web UI, or via the HTTP API: | ||
|
|
||
| - **Scenarios** — the five built-in failure scenarios (`third-party-outage`, `timeout-spike`, `poison-message`, `deserialization-failure`, `background-noise`), each producing naturally-grouped errors. Start with `POST /api/scenarios/{name}/start` (optional `rate` and `durationSeconds`). | ||
| - **Bypass writer** — high-throughput load that writes failed-message envelopes directly to the ServiceControl error queue, skipping the message handler (`POST /api/bypass/start`). | ||
| - **Jobs** — retry, archive, search, retention sweep, and custom-check-failure jobs exercise ServiceControl's recoverability, FTS search, and retention pipelines against the load. Jobs do not auto-start; kick them off from the UI or `/api/jobs`. | ||
| - **Release-test presets** — named presets mapped from the [testing scenarios](testing-scenarios.md), e.g. `POST /api/release-tests/ingestion-load/start`. | ||
|
|
||
| ## Observing the run | ||
|
|
||
| - The Aspire dashboard shows logs and traces for every service. | ||
| - Grafana (auto-provisioned; log in with `admin`/`admin`) ships a prebuilt "Testing Tool" dashboard — errors/sec by scenario, search latency p95, replay/archive rates, and errors raised vs ingested. | ||
| - Jaeger for trace analysis, Prometheus for metrics. The tool also exposes a Prometheus scraping endpoint at `/metrics`. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <Project> | ||
|
|
||
| <!-- | ||
| The testing tool is a self-contained, stateless .NET 10 service kept outside the main | ||
| ServiceControl `src/` tree so it is not swept into the platform build. These properties mirror | ||
| the conventions used by the rest of the repository (warnings-as-errors, code-style enforcement, | ||
| nullable reference types, implicit usings) without inheriting the platform packaging targets. | ||
| --> | ||
| <PropertyGroup> | ||
| <TargetFramework>net10.0</TargetFramework> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| <TreatWarningsAsErrors Condition="'$(Configuration)' != 'Debug'">true</TreatWarningsAsErrors> | ||
| <EnableNETAnalyzers>true</EnableNETAnalyzers> | ||
| <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild> | ||
| <NuGetAuditLevel>low</NuGetAuditLevel> | ||
| <NuGetAuditMode Condition="'$(NuGetAuditMode)' == ''">all</NuGetAuditMode> | ||
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup Condition="'$(CI)' != ''"> | ||
| <ContinuousIntegrationBuild>true</ContinuousIntegrationBuild> | ||
| </PropertyGroup> | ||
|
|
||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Multi-stage build for the ServiceControl testing tool. | ||
| # Build context is the repository root so global.json + nuget.config are available. | ||
| ARG RUNTIMEVERSION=10.0 | ||
|
|
||
| # --- build stage --- | ||
| FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build | ||
| ARG TARGETARCH | ||
| WORKDIR /src | ||
| ENV CI=true | ||
|
|
||
| # global.json pins the SDK; nuget.config adds the Particular feed for later NServiceBus deps. | ||
| COPY global.json nuget.config ./ | ||
| COPY tools/testing-tool/ ./tools/testing-tool/ | ||
|
|
||
| # Publish the runnable host; its ProjectReferences pull in Contracts + Scenarios. | ||
| RUN dotnet publish tools/testing-tool/TestingTool/TestingTool.csproj \ | ||
| --configuration Release \ | ||
| --arch $TARGETARCH \ | ||
| --output /app \ | ||
| /p:UseAppHost=false | ||
|
|
||
| # --- runtime stage --- | ||
| # Uses the same chiseled composite base as the rest of the ServiceControl images so that | ||
| # globalization/ICU dependencies are present. | ||
| FROM mcr.microsoft.com/dotnet/aspnet:$RUNTIMEVERSION-noble-chiseled-composite-extra | ||
| WORKDIR /app | ||
|
|
||
| COPY --from=build /app ./ | ||
|
|
||
| ENV ASPNETCORE_URLS=http://+:8080 | ||
| EXPOSE 8080 | ||
|
|
||
| # Health probes are served by the /health/live and /health/ready HTTP endpoints (added in | ||
| # Phase 6). Kubernetes uses HTTP GET probes directly; the chiseled base ships no shell/curl so | ||
| # exec-based probes are not supported. | ||
|
|
||
| USER $APP_UID | ||
| ENTRYPOINT ["dotnet", "TestingTool.dll"] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.