How to fail a k6 run inside kubernetes

I am running the k6 docker image inside kubernetes as a job spec.

I would like to know how to fail the run of the test within a kubernetes job and mark the job status as failed?

1 Like


The best way is to use thresholds. You should set an upper limit on any metric, so as abort them on fail, in case the metric is surpassed the required limit. Also have a look at this example.

1 Like