Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark test as flaky #2437

Merged
merged 2 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ deps =
-c dev-requirements.txt
opentelemetry: pytest
opentelemetry: pytest-benchmark
opentelemetry: flaky
coverage: pytest
coverage: pytest-cov
mypy,mypyinstalled: mypy
Expand Down