Skip to content

test: add dataset sizes, expensive query and authentication load tests - #167

Merged
Dejmenek merged 5 commits into
mainfrom
feat/165-loadtests-dataset-auth
Sep 29, 2026
Merged

Dejmenek merged 5 commits into
mainfrom
feat/165-loadtests-dataset-auth

Conversation

@Dejmenek

@Dejmenek Dejmenek commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

This is the second PR for #165 and it is stacked on #166. It adds larger datasets, session helpers and three new groups of load tests: mixed browsing, expensive queries and the authentication flow.

Datasets

LoadTestDataSeeder generates Medium (50 users, 25 tournaments) and Large (200 users, 100 tournaments) datasets. Tournaments cycle through open, closed, completed and round robin, so standings have real matches to compute. The factory seeds through an overridable SeedAsync and exposes the tournament ids, round robin ids and user emails that scenarios pick from. Load test clients no longer handle cookies, so virtual users do not share one refresh token.

Helpers

  • GraphQLLoadStep can send a refresh token cookie, pass the response headers and body to a callback, and treat a GraphQL error as an expected rejection through a predicate.
  • VirtualUserSessions logs users in once during scenario init and picks a session per invocation.
  • LoadTestRun.ExecuteAll runs several scenarios in one NBomber run and reports every failed threshold together.
  • Step budgets come from measured baselines per dataset size. A step without a baseline fails loudly instead of falling back to a guess.

New tests

  • Mixed browsing runs list, view and discover scenarios together against the default, Medium and Large datasets.
  • Expensive queries (Medium and Large) cover owner and participant tournament history, round robin standings, the authenticated own history and the oversized page rejection.
  • The authentication flow logs in, reads the profile, refreshes the session and logs out. It sends the newest refresh cookie after every rotation, because reusing a revoked token revokes all of that user's tokens.

Testing

All six new load tests pass locally. This PR only changes the load test project, so the unit and integration tests are unaffected and CI will run them. The load tests need Docker and run manually with dotnet test TournamentAPI.LoadTests --filter "Category=Load".

Part of #165.

Stack created with GitHub Stacks CLI • Give Feedback 💬

🤖 Generated with Claude Code

Dejmenek and others added 5 commits September 29, 2026 14:00
The factory now seeds through an overridable SeedAsync and exposes the
tournament ids, round robin tournament ids and user emails that scenarios
pick from. LoadTestDataSeeder generates users and a cycle of open, closed,
completed and round robin tournaments, so standings have real matches to
compute. Load test clients stop handling cookies, so virtual users no longer
share one refresh token cookie.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
GraphQLLoadStep can send a refresh token cookie, hand the response headers and
body to a callback, and classify a GraphQL error as an expected rejection by
predicate. VirtualUserSessions logs users in once during scenario init and
picks a session per invocation. LoadTestRun.ExecuteAll runs several scenarios
in one NBomber run and reports every failed threshold together. Step budgets
come from measured baselines per dataset size, with headroom ratios and floors
applied in code, and a step without a baseline fails loudly.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Run list, view and discover scenarios concurrently at a fixed arrival rate
against the default, Medium and Large datasets. Each step is checked for
health, tail latency and payload size against its measured budget. The rate is
about 25 requests per second because this mix saturates the in-process host
between 25 and 50.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Cover owner and participant tournament history, round robin standings, the
authenticated own history and the oversized page rejection. The history
queries are the slowest steps today, and their measured cost is recorded in
the budgets instead of being fixed here. The oversized page request counts as
an expected rejection, recognised by its maxAllowedItems extension.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Each iteration logs in, reads the profile, refreshes the session and logs out.
The refresh token cookie is handled by hand because load test clients do not
keep cookies, and the newest cookie is sent after every rotation, since reusing
a revoked token revokes all of the user's tokens.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Dejmenek
Dejmenek added this pull request to stack #168 September 29, 2026 14:09
@Dejmenek Dejmenek changed the title feat/165 loadtests dataset auth test: add dataset sizes, expensive query and authentication load tests Sep 29, 2026
@Dejmenek
Dejmenek marked this pull request as ready for review September 29, 2026 19:43
Base automatically changed from test/165-improve-load-test-quality-and-expand-scenario-coverage to main September 29, 2026 19:50
@Dejmenek
Dejmenek merged commit c97a3d5 into main Sep 29, 2026
5 checks passed
@Dejmenek
Dejmenek deleted the feat/165-loadtests-dataset-auth branch September 29, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant