Skip to content

Commit

Permalink
Improve errext.AbortedByThresholdsAfterTestEnd comments
Browse files Browse the repository at this point in the history
  • Loading branch information
na-- committed Jan 23, 2023
1 parent bcceeb3 commit be3aa5f
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions output/cloud/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,23 @@ func (out *Output) getRunStatus(testErr error) cloudapi.RunStatus {
case errext.AbortedByTimeout:
return cloudapi.RunStatusAbortedLimit
case errext.AbortedByThresholdsAfterTestEnd:
// The test finished normally, it wasn't prematurely aborted. Such
// failures are tracked by the restult_status, not the run_status
// (so called "tainted" in some places of the API here).
// The test run finished normally, it wasn't prematurely aborted by
// anything while running, but the thresholds failed at the end and
// k6 will return an error and a non-zero exit code to the user.
//
// However, failures are tracked somewhat differently by the k6
// cloud compared to k6 OSS. It doesn't have a single pass/fail
// variable with multiple failure states, like k6's exit codes.
// Instead, it has two variables, result_status and run_status.
//
// The status of the thresholds is tracked by the binary
// result_status variable, which signifies whether the thresholds
// passed or failed (failure also called "tainted" in some places of
// the API here). The run_status signifies whether the test run
// finished normally and has a few fixed failures values.
//
// So, this specific k6 error will be communicated to the cloud only
// via result_status, while the run_status will appear normal.
return cloudapi.RunStatusFinished
}
}
Expand Down

0 comments on commit be3aa5f

Please sign in to comment.