Skip to content

Commit

Permalink
Mark test as flaky
Browse files Browse the repository at this point in the history
Fixes #2436
  • Loading branch information
ocelotl committed Feb 3, 2022
1 parent cade607 commit 69f9cea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ readme-renderer~=24.0
grpcio-tools~=1.41.0
mypy-protobuf~=3.0.0
protobuf~=3.18.1
flaky>=3.7.0
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import time
from unittest.mock import Mock

from flaky import flaky

from opentelemetry.sdk._metrics.export import (
MetricExporter,
PeriodicExportingMetricReader,
Expand Down Expand Up @@ -99,13 +101,14 @@ def test_ticker_called(self):
self.assertTrue(collect_mock.assert_called_once)
pmr.shutdown()

@flaky(max_runs=3, min_passes=1)
def test_ticker_collects_metrics(self):
exporter = FakeMetricsExporter()

pmr = self._create_periodic_reader(
metrics_list, exporter, interval=100
)
time.sleep(0.11)
time.sleep(0.15)
self.assertEqual(exporter.metrics, metrics_list)
pmr.shutdown()

Expand Down

0 comments on commit 69f9cea

Please sign in to comment.