k6 icon indicating copy to clipboard operation
k6 copied to clipboard

Rename conflicting abort and fail functions

Open MoKhajavi75 opened this issue 6 months ago • 0 comments
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 😃

MoKhajavi75 avatar May 05 '25 23:05 MoKhajavi75