예제 #1
0
def test_remove_projects_from_lpq_unset(
        store: RedisRealtimeMetricsStore,
        redis_cluster: redis._RedisCluster) -> None:
    removed = store.remove_projects_from_lpq({1})
    assert removed == 0

    remaining = redis_cluster.smembers("store.symbolicate-event-lpq-selected")
    assert remaining == set()
예제 #2
0
def test_add_project_to_lpq_filled(store: RedisRealtimeMetricsStore,
                                   redis_cluster: redis._RedisCluster) -> None:
    redis_cluster.sadd("store.symbolicate-event-lpq-selected", 11)

    added = store.add_project_to_lpq(1)
    assert added
    in_lpq = redis_cluster.smembers("store.symbolicate-event-lpq-selected")
    assert in_lpq == {"1", "11"}
예제 #3
0
def test_remove_projects_from_lpq_backing_off_removing(
        store: RedisRealtimeMetricsStore,
        redis_cluster: redis._RedisCluster) -> None:
    store.add_project_to_lpq(1)
    in_lpq = redis_cluster.smembers("store.symbolicate-event-lpq-selected")
    assert in_lpq == {"1"}
    assert redis_cluster.get(f"{store._backoff_key_prefix()}:1") == "1"

    removed = store.remove_projects_from_lpq({1})
    assert not removed