Exemple #1
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()
Exemple #2
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}