Skip to content

Commit

Permalink
Use flaky instead
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Jul 3, 2024
1 parent cc26486 commit 4d433d6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion opentelemetry-sdk/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
pytest-retry==1.6.3
flaky==3.8.1
-e tests/opentelemetry-test-utils
-e opentelemetry-api
-e opentelemetry-semantic-conventions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from typing import Optional, Sequence
from unittest.mock import Mock

from pytest import mark
from flaky import flaky

from opentelemetry.sdk.metrics import Counter, MetricsTimeoutError
from opentelemetry.sdk.metrics._internal import _Counter
Expand Down Expand Up @@ -190,7 +190,7 @@ def test_ticker_value_exception_on_negative(self):
export_interval_millis=-100,
)

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

Expand Down
7 changes: 2 additions & 5 deletions opentelemetry-sdk/tests/trace/export/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from unittest import mock

from pytest import mark
from flaky import flaky

from opentelemetry import trace as trace_api
from opentelemetry.context import Context
Expand Down Expand Up @@ -461,11 +462,7 @@ def _target():

span_processor.shutdown()

@mark.flaky(
retries=3,
only_on=[AssertionError],
condition=(python_implementation == "PyPy" or system() == "Windows"),
)
@flaky(max_runs=3, min_passes=1)
def test_batch_span_processor_scheduled_delay(self):
"""Test that spans are exported each schedule_delay_millis"""
spans_names_list = []
Expand Down

0 comments on commit 4d433d6

Please sign in to comment.