def run_failure_test(config_file: str, model_def_file: str, error_str: Optional[str]=None) -> None:
    experiment_id = create_experiment(config_file, model_def_file)
    wait_for_experiment_state(experiment_id, 'ERROR')
    assert (num_active_trials(experiment_id) == 0)
    assert (num_completed_trials(experiment_id) == 0)
    assert (num_error_trials(experiment_id) >= 1)
    trials = experiment_trials(experiment_id)
    for t in trials:
        if (t['state'] != 'ERROR'):
            continue
        trial_id = t['id']
        logs = trial_logs(trial_id)
        if (error_str is not None):
            assert any(((error_str in line) for line in logs))
def run_failure_test(config_file: str, model_def_file: str, error_str: Optional[str]=None) -> None:
    experiment_id = create_experiment(config_file, model_def_file)
    wait_for_experiment_state(experiment_id, 'ERROR')
    assert (num_active_trials(experiment_id) == 0)
    assert (num_completed_trials(experiment_id) == 0)
    assert (num_error_trials(experiment_id) >= 1)
    trials = experiment_trials(experiment_id)
    for t in trials:
        if (t['state'] != 'ERROR'):
            continue
        trial_id = t['id']
        logs = trial_logs(trial_id)
        if (error_str is not None):
            assert any(((error_str in line) for line in logs))