diff --git a/src/data/markdown/docs/01 guides/02 Using k6/14 Executors.md b/src/data/markdown/docs/01 guides/02 Using k6/14 Executors.md index 8971c14449..955a54d3ae 100644 --- a/src/data/markdown/docs/01 guides/02 Using k6/14 Executors.md +++ b/src/data/markdown/docs/01 guides/02 Using k6/14 Executors.md @@ -30,16 +30,18 @@ extensible. ## Shared configuration Below you can see the list of all executors and their options, but since all -executors share a base configuration, the following options can be used for all: +executors share a base configuration, the following options can be used for all*: | Option | Type | Description | Default | |----------------|--------|----------------------------------------------------------------------------------|-------------| | `startTime` | string | Time offset since test start this scenario should begin execution. | `"0s"` | -| `gracefulStop` | string | Time to wait for iterations to finish executing before stopping them forcefully. | `"30s"` | +| `gracefulStop` | string | Time to wait for iterations to finish executing before stopping them forcefully. See the [gracefulStop](#graceful-stop-and-ramp-down) section. | `"30s"` | | `exec` | string | Name of exported JS function to execute. | `"default"` | | `env` | object | Environment variables specific to this scenario. | `{}` | | `tags` | object | [Tags](/using-k6/tags-and-groups) specific to this scenario. | `{}` | +\* Except `gracefulStop` which is disabled for the externally-controlled executor. + ## Executor types @@ -144,6 +146,63 @@ only affect the externally controlled executor. | `maxVUs` | integer | Maximum number of VUs to allow during the test run. | - | +## Graceful stop and ramp down + +In versions before v0.27.0, k6 would interrupt any iterations being executed if the +test is done or when ramping down VUs when using the `stages` option. This behavior +could cause skewed metrics and wasn't user configurable. + +In v0.27.0 a new option is introduced for all executors: `gracefulStop`. With a +default value of `30s`, it specifies the time k6 should wait for iterations to +complete before forcefully interrupting them. + +A similar option exists for the ramping VUs executor: `gracefulRampDown`. This +specifies the time k6 should wait for any iterations in progress to finish before +VUs are returned to the global pool during the ramp down period defined in `stages`. + +### Example + +