Skip to content

✨(load-tests) add JMeter load-testing scenarios - #791

Open
NathanVss wants to merge 4 commits into
mainfrom
feat/load-testing
Open

✨(load-tests) add JMeter load-testing scenarios#791
NathanVss wants to merge 4 commits into
mainfrom
feat/load-testing

Conversation

@NathanVss

@NathanVss NathanVss commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Purpose

Measure backend response times and error codes under loado n any instance. WOPI editors and the IDP are out of scope:
authentication goes through the e2e user-auth endpoint, like the e2e tests.

Proposal

Backend — a safe way to expose the e2e auth endpoints on a production-like
target:

  • LOAD_E2E_URLS stays a plain literal (never readable from the environment)
    and post_setup refuses to boot any configuration outside an explicit
    allowlist that would enable it.
  • New LoadTest(Production) configuration: identical to Production but with
    the endpoints enabled. Deploying DJANGO_CONFIGURATION=LoadTest is the only
    way to expose them on a production-derived setup.

load-tests/ — two JMeter scenarios, fully property-driven (BASE_URL,
USERS, RAMP_UP, DURATION, USER_OFFSET, USER_EMAIL, think times...):

  • drive-session.jmx: a full user session — login, app bootstrap, browse,
    recents, shared-with-me, folder creation, upload, trash, hard-delete —
    with randomized think times between actions. Uploads reproduce the frontend
    flow (item creation, presigned PUT to object storage, upload-ended) and
    randomly pick an entry from load-tests/files/; folder entries mirror the
    frontend folder upload (hierarchy first, then each file into its parent).
  • drive-session-read-heavy.jmx: realistic read-dominant traffic. Every
    session browses; only UPLOAD_PCT% (default 15) also write. Each user seeds
    its account on its first session so reads hit real data, and a tearDown
    thread group hard-deletes everything at the end of the run, including
    folders orphaned by interrupted iterations.

Distributed runs use independent injectors with per-machine USER_OFFSET
(see load-tests/README.md for the full parameter list, the rationale and
the results-merging procedure). Every request asserts its expected status
code so any deviation surfaces in the HTML dashboard with the actual code.

Load-test scenarios authenticate through the e2e user-auth endpoint, which
must be available on a production-like instance without enabling DEBUG.
LOAD_E2E_URLS is kept as a plain literal so no environment variable can
ever flip it, and post_setup refuses to start any configuration outside an
explicit allowlist that would expose it. Deploying with
DJANGO_CONFIGURATION=LoadTest becomes the only way to expose these
endpoints on a Production-derived setup, making it a deliberate and
reviewable infrastructure decision.
We need to measure backend response times and error codes from 100 up to
100k simultaneous users, on any instance. The scenario simulates a full
user session (browse, recents, shared-with-me, folder creation, upload,
trash, hard-delete) with randomized think times, using the e2e auth
endpoint instead of the IDP, out of scope like the WOPI editors.

Everything is property-driven (BASE_URL, USERS, USER_OFFSET...) so the
same plan runs unchanged against any instance and across distributed
injectors, each with its own USER_OFFSET to keep generated user emails
globally unique. Uploads reproduce the frontend flow (item creation,
presigned PUT to the object storage, upload-ended) and randomly pick a
fixture entry; folder entries mirror the frontend folder upload by
materializing the hierarchy before uploading each file into its parent.
The mixed scenario writes on every session, while real drive traffic is
massively read-dominant. This variant keeps the same building blocks but
only UPLOAD_PCT percent of sessions (15 by default) go through the write
path; every session browses root items, recents, shared-with-me and
navigates into a randomly picked folder and subfolder.

To make reads meaningful despite empty fresh accounts, the first session
of each user always uploads the fixture folder tree and keeps it for the
whole run. Seed folders are left behind on purpose: the target instance
is reset by ops (database and bucket) between test campaigns.
Required by the check-changelog CI job.
@NathanVss
NathanVss force-pushed the feat/load-testing branch from 08245c4 to b346f8c Compare July 29, 2026 15:23
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
D Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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