def METHOD_NAME(tmp_path):
    # define the variable you want to optimize
    problem = HpProblem()
    problem.add_hyperparameter((0.0, 10.0), "x")
    stopper = SuccessiveHalvingStopper(max_steps=50, reduction_factor=3)
    search = CBO(
        problem,
        run_with_failures,
        surrogate_model="RF",
        stopper=stopper,
        random_state=42,
        filter_failures="mean",
        log_dir=tmp_path,
    )
    results = search.search(max_evals=50)
    assert "m:budget" in results.columns
    assert "m:stopped" in results.columns
    assert "p:x" in results.columns
    assert "objective" in results.columns
    assert pd.api.types.is_string_dtype(results.objective)
    results = results[~results.objective.str.startswith("F")]
    results.objective = results.objective.astype(float)
    # The constraint inside the run-function should make the job fail if > 450
    assert results.objective.max() < 450
    # Test the optimization worked
    assert results.objective.max() > 449