Allow tests to run for an infinite duration #2701
Labels
docs
evaluation needed
proposal needs to be validated or tested before fully implementing it in k6
feature
Feature Description
We would like to run tests for an infinite duration, i.e., until we manually kill them or kill them as part of a new deployment.
The docs say, under Performance and synthetic monitoring:
We would like to do exactly this - use k6 to send a steady stream of traffic through several synthetics. However, I can’t find anything around how to actually configure an infinite duration in the docs, in the code, in the forums, or here on GitHub.
This is related to this forum post (I am the other of the post and this feature request).
Suggested Solution (optional)
Currently the
config
JavaScript object requires a duration for each stage. For example, the following configuration runs a single stage ramping up to 500 VUs over thirty seconds:Proposal 1 - Allow an infinite duration value
Currently the values for each stage MUST contain a positive time value for
duration
. If we allow the user to specify a special string such as'infinite'
, the test can run until it is manually stopped. For example, the following configuration ramps up smoothly to 500 VUs over thirty seconds then runs 500 VUs indefinitely until the process is manually stopped:Proposal 2 - Allow an unspecified duration
Currently the values for each stage MUST contain a
duration
. By removing this requirement, the user could omit the duration, causing the test to run until it is manually stopped. For example, the same configuration from Proposal 1 could be specified with:All else equal I would favor the first proposal as it requires the user to perform an action to achieve an indefinitely running process. In cases where the user forgets to specify the duration, she continues to receive an error message. The error message could be updated to include something like:
Checks could also be added to ensure no additional stages are defined following an infinite stage.
Note: Allowing
duration: '0'
was considered but not proposed as this runs the given scenario exactly one time. If this behavior is relied upon in existing tests, changing it would be a breaking change.In either case, accumulation and presentation of statistics will need to be considered. This is not a problem for users who ship results to an external datastore such as Prometheus. Other user requirements will vary.
Already existing or connected issues / PRs (optional)
I searched open and closed issues but could not identify any related feature requests.
The text was updated successfully, but these errors were encountered: