Is it possible to fail a load test?

It’s not really possible to fail a load test because by default it always ends with status ‘Completed’. Because of that anytime a load test completes one musts analyze the results – if performance stayed at the acceptable level. So, despite being a powerful tool, load tests require human attention, which makes the whole testing process less automate.

Luckily, load tests can be enhanced with plugins. I don’t want to describe how to create a plugin here; if you are interested have a look at a very good description provided by Gabriel Szlechtman. Following that advice you can easily extend a load test so that it stops whenever there’s a threshold violation (it is defined for a counter, e.g. page load time, CPU usage). All you need to do is to use Abort() or Abort(Exception) of LoadTest class. The latter is probably more convenient because it allows revealing the reason why the test was aborted.

At the end of a day, once the test is aborted it’s status is set to ‘Error’, which can be treated as ‘Failed’ in your automated testing process.

loadtestresult

Previous Post
Next Post