# Stop on First Failure Example
URL: /examples/stop-on-first-failure
The upstream stop_on_first_failure.py example — end the test at the first failed measurement using test.configure(stop_on_first_failure=True) or the equivalent configuration key.
Two ways to make OpenHTF stop as soon as a measurement fails. Based on `examples/stop_on_first_failure.py`.
`hello_world` does not appear in the record.
A `TestOptions` field. The phase whose measurement failed finishes; nothing after it runs. Test Options →
The same switch through the configuration system, so `--config-value stop_on_first_failure=true` or a per-station YAML file can turn it on during debugging and off in production. Configuration →
The kwargs declaration form with a validator object from `openhtf.util.validators`. Measurements example →
On a production line you usually want *all* cheap failures recorded in one pass so the repair technician sees everything wrong with the unit. Reserve `stop_on_first_failure` for debugging, and use checkpoints before expensive phases in production.