Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Don't enforce the test for the hack on old prometheus-client versions…
Browse files Browse the repository at this point in the history
… before it was possible
  • Loading branch information
reivilibre committed Aug 17, 2022
1 parent 47d4b9e commit b9bd286
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# limitations under the License.
from unittest.mock import Mock, patch

import importlib_metadata
from pkg_resources import parse_version

from synapse.app._base import _set_prometheus_client_use_created_metrics
from synapse.metrics import REGISTRY, InFlightGauge, generate_latest
from synapse.util.caches.deferred_cache import DeferredCache
Expand Down Expand Up @@ -167,6 +170,11 @@ def test_cache_metric(self):


class PrometheusMetricsHackTestCase(unittest.HomeserverTestCase):
if parse_version(importlib_metadata.version("prometheus_client")) < parse_version(
"0.14.0"
):
skip = "prometheus-client too old"

def test_created_metrics_disabled(self) -> None:
"""
Tests that a brittle hack, to disable `_created` metrics, works.
Expand Down

0 comments on commit b9bd286

Please sign in to comment.