Add tests for the failure threshold check