def test_add_probability_filter_passed_no_nodes_metric(prometheus_noop_scenario):
    """
    Ensures that add_probability_filter_passed_no_nodes_metric is called when
    the filter decides to pass no nodes based on a probability
    """
    assert prometheus_noop_scenario.name == "test scenario"
    random.seed(6)  # make the tests deterministic
    candidates = [make_dummy_object()]

    before = REGISTRY.get_sample_value(PROBABILITY_FILTER_NOT_PASSED_METRIC_NAME)
    assert before == 0

    criterion = {"probabilityPassAll": 0.00000001}
    prometheus_noop_scenario.filter_probability(candidates, criterion)

    after = REGISTRY.get_sample_value(PROBABILITY_FILTER_NOT_PASSED_METRIC_NAME)
    assert after == 1

    Ensures that add_probability_filter_passed_no_nodes_metric is called when
    the filter decides to pass no nodes based on a probability
    
tests/metriccollectors/test_prometheus_collector.py