k6
k6 copied to clipboard
Rename conflicting abort and fail functions
trafficstars
Feature Description
Hey :)
The current naming of fail(), exec.test.fail() and exec.test.abort() is confusing due to their overlapping names but different behaviors:
| Function | Purpose | Exit Code | Link |
|---|---|---|---|
fail |
Fails current iteration only | 0 | ref |
exec.test.fail |
Marks test as failed but continues running | 110 | ref |
exec.test.abort |
Aborts the entire test run immediately | 108 | ref |
Suggested Solution (optional)
Clearer, more distinct names would improve readability and reduce misuse.
IMHO, exec.test.fail and exec.test.abort are good to go but I suggest fail to be renamed to softFail. It clearly implies:
- It's a failure,
- It's non-critical,
- It doesn’t stop the test or mark it failed globally.
Already existing or connected issues / PRs (optional)
I'll be happy to submit a PR 😃