Пример #1
0
def test_get_lpq_projects_empty(store: RedisRealtimeMetricsStore,
                                redis_cluster: redis._RedisCluster) -> None:
    redis_cluster.sadd("store.symbolicate-event-lpq-selected", 1)
    redis_cluster.srem("store.symbolicate-event-lpq-selected", 1)

    in_lpq = store.get_lpq_projects()
    assert in_lpq == set()
Пример #2
0
    def test_is_eligible_recently_moved(
        self, store: RedisRealtimeMetricsStore, monkeypatch: "pytest.MonkeyPatch"
    ) -> None:
        store._backoff_timer = 10
        # Abusing the fact that removing always updates the backoff timer even if it's a noop
        store.remove_projects_from_lpq({17})

        monkeypatch.setattr(
            low_priority_symbolication, "excessive_event_rate", lambda proj, counts: True
        )

        _update_lpq_eligibility(17, 10)
        assert store.get_lpq_projects() == set()
Пример #3
0
def test_get_lpq_projects_unset(store: RedisRealtimeMetricsStore) -> None:
    in_lpq = store.get_lpq_projects()
    assert in_lpq == set()
Пример #4
0
    def test_not_eligible_recently_moved(self, store: RedisRealtimeMetricsStore) -> None:
        store._backoff_timer = 10
        store.add_project_to_lpq(17)

        _update_lpq_eligibility(17, 10)
        assert store.get_lpq_projects() == {17}