Skip to main content

Load Testing Configuration

TestFly provides a centralized loadtest: configuration block in testfly.yml. This allows teams to define global sensible defaults for performance runs across local and CI environments.


1. The loadtest: Block​

Add the optional loadtest: section to your testfly.yml:

loadtest:
enabled: false # reserved flag; explicit runner calls are not currently gated
baseUrl: https://api.example.com
engine: auto # auto (prefers Gatling if present, else JDK) | gatling | jdk
users: 10 # default concurrent virtual users
rampUp: 10s # linear ramp-up duration (e.g. 10s, 1m)
hold: 30s # peak load sustain duration (e.g. 30s, 5m)
cooldown: 5s # cooldown period after test run (e.g. 5s)
maxUsers: 1000 # safety ceiling on concurrent users
resultsDir: target/loadtest # target directory for metrics and reports
reportEnabled: true # generate standalone HTML load test report
requestTimeoutSeconds: 30 # HTTP connection and request read timeout in seconds

2. Configuration Reference​

PropertyTypeDefaultDescription
enabledbooleanfalseReserved effective flag (overridable via features.loadtest); the current LoadTestRunner.run() path does not enforce it.
baseUrlstringnullTarget URL after scenario/annotation overrides. Gatling falls back to execution.baseUrl; the JDK engine requires this value or a scenario/annotation URL.
enginestringautoExecution engine: auto (prefers Gatling if present, falls back to JDK), gatling (strictly Gatling), or jdk (native virtual threads).
usersint10Default number of concurrent virtual users if not specified in code.
rampUpstring10sLinear ramp-up period to reach peak virtual users (e.g. 10s, 1m).
holdstring30sDuration to sustain peak virtual users (e.g. 30s, 5m).
cooldownstring5sCooldown period after peak load finishes (e.g. 5s).
maxUsersint1000Safety ceiling for maximum allowed concurrent users.
resultsDirstringtarget/loadtestOutput directory where load test metrics and reports are saved.
reportEnabledbooleantrueGenerates standalone HTML load test report and correlates native Gatling interactive reports.
requestTimeoutSecondsint30HTTP connection and request read timeout in seconds.

3. Environment Profiles & CI Overrides​

TestFly profiles allow you to define lightweight parameters for local smoke testing while executing high-concurrency benchmarks in CI pipelines:

testfly.yml (Local Default)​

loadtest:
engine: auto
users: 5
rampUp: 2s
hold: 5s

testfly-performance.yml (CI Staging / Benchmark Profile)​

loadtest:
engine: gatling
users: 250
rampUp: 30s
hold: 120s
cooldown: 10s
reportEnabled: true

Activate the profile with Maven:

mvn test -Dtestfly.profile=performance

4. Feature Switchboard Integration​

Under TestFly's master switchboard, load testing can also be toggled globally across all suites:

features:
loadtest: false # Completely disables load test execution across all suites