Fail-Fast Testing: How to Stop Test Suites Early and Save CI/CD Time

stop test execution fail fast

Fail-fast testing stops a test run as soon as failures pass a threshold, saving CI/CD time and infrastructure cost. Learn the fail-fast principle, how to set failure thresholds in Katalon Studio, and how to track trends in TestOps.

Key takeaways
The 30-second version of this article
The fail-fast principle stops a system at the first sign of a flaw rather than letting it continue on bad code.
Failing fast surfaces bugs earlier, keeps more defects out of production, and lowers the cost of fixing them.
Katalon Studio 8.1 added failure thresholds via the -maxFailedTests CLI option to stop test suite runs early.
Stopping failing runs early frees testing devices and cuts infrastructure costs, especially in the cloud.
Connecting Studio to Katalon TestOps lets teams review pass/fail trends across test runs.

The Fail-Fast Principle in Software Testing

Fail-fast principle Katalon Studio

In software development, a fail-fast system reports a failure immediately instead of continuing to run. The fail-fast principle is built on the idea that a system should stop normal operations rather than try to work around a flawed piece of code.

The fail-fast principle makes software bugs easier to detect earlier in the development cycle. It allows for faster strengthening of the code under development, limits the number of bugs that make it into production, and reduces the intrinsic cost of letting bugs in the code.

In short, it is better to fail fast and fail often during development than to fail later when the product is about to be released.

One of the benefits of test automation is the ability to test early, often, and anywhere in the development cycle. Katalon Studio 8.1 introduced a feature that makes your automation cycle more efficient and cost-effective. Applying the fail-fast principle, Studio 8.1 lets users stop Test Suite executions when a set failure threshold is reached.

This new feature will help make more efficient use of testing devices and improve infrastructure costs, especially for cloud users.

Fail Fast, Fail Often in Katalon Studio: Terminate Execution Conditionally

Failure thresholds in Katalon Studio 8.1 let users terminate a Test Suite or Test Suite Collection execution when a significant number of test cases have failed. This gives teams feedback earlier, rather than waiting until the whole test cycle is complete.

To use this feature, add the new command option -maxFailedTests=T, where T is the maximum number of failed executions allowed before the test is stopped. Once the execution stops, Katalon Studio generates a report with all the insights. This feature is only available for tests executed through the CLI or CI using Katalon Runtime Engine.

First, find the option to set the threshold in the Generate Command for Console Mode dialog box. Set your failure tolerance by ticking the box “Terminate the execution once the total number of test failures reaches this threshold” and typing a number in the text field.

Test-Failure-Thresholds

Generate the CLI command, which will now include the -maxFailedTests= parameter.

Generate-the-CLI-command

Run the execution. Once it reaches the threshold, a message in the CLI indicates that the execution stopped because of the failure rule.

Stop-a-test-suite-execution-when-a-test-case-fails

You can also take a look at the summary of passed and failed tests generated by Studio in the Test Cases Table within the reports:

Pass_Fail-tests-for-each-test-run.png

To learn more about using this feature in your testing environment, check out the Katalon Studio 8.x release notes.

Wrapping Up

Failure thresholds were introduced in Studio 8.1 and remain available in later versions. Download the latest version of Katalon Studio to start using fail-fast execution in your pipeline.

For a complete list of new features, improvements, and fixes, visit the release notes. As always, please post any questions, ideas, or concerns on our community site. We are eager to hear from you.

Trigger modal

Frequently asked questions

Huyen Nguyen
Huyen NguyenTechnical Writer, Katalon

Huyen Nguyen is an experienced technical writer in the software testing industry. With strong technical expertise and a deep understanding of Katalon products, she creates clear, practical guides that support testers at every skill level.

Connect on LinkedIn →
Get started

Test everything. Ship with confidence.

From generating test cases to spotting failures, Katalon's AI works across your entire pipeline, automatically.

Live webinar

The Next Evolution of Manual Testing: Introducing Katalon AI Test Runner

Learn how to grow your QA team's capacity in the age of AI, then watch Katalon AI Test Runner turn manual test cases into automated runs, live.

2:00 to 3:00 PM IST
Almas AhmedSenior Account Manager
Sumit WankhedeSolutions Engineer Manager
Register now