Skip to main content
Parallel execution runs independent requests concurrently, reducing total test suite time. Requests with dependencies (@depends) always run sequentially.

Enabling Parallel Mode

hitspec run tests/ --parallel
Short form:
hitspec run tests/ -p

Concurrency Limit

Control the maximum number of simultaneous requests:
hitspec run tests/ --parallel --concurrency 10
FlagDefaultDescription
--parallelfalseEnable parallel execution
--concurrency5Maximum concurrent requests

Configuration

Set parallel mode in hitspec.yaml to avoid passing flags every time:
parallel: true
concurrency: 10

How Dependencies Work

hitspec respects the dependency graph when running in parallel:
### Create user
# @name createUser
POST {{baseUrl}}/users
Content-Type: application/json

{"name": "John"}

>>>capture
userId from body.id
<<<

### Get user (depends on createUser)
# @name getUser
# @depends createUser

GET {{baseUrl}}/users/{{createUser.userId}}

>>>
expect status 200
<<<

### List products (independent)
# @name listProducts

GET {{baseUrl}}/products

>>>
expect status 200
<<<
In this example, listProducts runs concurrently with createUser. But getUser waits for createUser to complete because of the @depends directive.
Captured variables from parallel requests are not shared. Only use captures across requests connected by @depends.

Environment Variables

VariableFlagDefault
HITSPEC_PARALLEL--parallelfalse
HITSPEC_CONCURRENCY--concurrency5