Skip to content

Commit dbe4869

Browse files
gnufedemajorgreys
andauthored
ci(flaky): skip more flaky tests (#8036)
More tests skipped via flaky decorator ## Checklist - [x] Change(s) are motivated and described in the PR description. - [x] Testing strategy is described if automated tests are not included in the PR. - [x] Risk is outlined (performance impact, potential for breakage, maintainability, etc). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed. If no release note is required, add label `changelog/no-changelog`. - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)). - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Title is accurate. - [x] No unnecessary changes are introduced. - [x] Description motivates each change. - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes unless absolutely necessary. - [x] Testing strategy adequately addresses listed risk(s). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] Release note makes sense to a user of the library. - [x] Reviewer has explicitly acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment. - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) - [x] If this PR touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from `@DataDog/security-design-and-guidance`. - [x] This PR doesn't touch any of that. --------- Co-authored-by: Tahir H. Butt <[email protected]>
1 parent dfd7a0a commit dbe4869

File tree

8 files changed

+24
-4
lines changed

8 files changed

+24
-4
lines changed

tests/appsec/appsec/test_processor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from ddtrace.contrib.trace_utils import set_http_meta
1717
from ddtrace.ext import SpanTypes
1818
from ddtrace.internal import core
19+
from tests.utils import flaky
1920
from tests.utils import override_env
2021
from tests.utils import override_global_config
2122
from tests.utils import snapshot
@@ -325,6 +326,7 @@ def test_appsec_span_tags_snapshot(tracer):
325326
assert "triggers" in json.loads(span.get_tag(APPSEC.JSON))
326327

327328

329+
@flaky(1735812000)
328330
@snapshot(
329331
include_tracer=True,
330332
ignores=[

tests/contrib/aiohttp/test_middleware.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from ddtrace.sampler import RateSampler
1414
from tests.opentracer.utils import init_tracer
1515
from tests.utils import assert_span_http_status_code
16+
from tests.utils import flaky
1617
from tests.utils import get_root_span
1718

1819
from .app.web import noop_middleware
@@ -360,6 +361,7 @@ async def test_wrapped_coroutine(app_tracer, aiohttp_client):
360361
assert span.duration > 0.25, "span.duration={0}".format(span.duration)
361362

362363

364+
@flaky(1735812000)
363365
async def test_distributed_tracing(app_tracer, aiohttp_client):
364366
app, tracer = app_tracer
365367
client = await aiohttp_client(app)
@@ -384,6 +386,7 @@ async def test_distributed_tracing(app_tracer, aiohttp_client):
384386
assert span.get_metric(SAMPLING_PRIORITY_KEY) is None
385387

386388

389+
@flaky(1735812000)
387390
async def test_distributed_tracing_with_sampling_true(app_tracer, aiohttp_client):
388391
app, tracer = app_tracer
389392
client = await aiohttp_client(app)
@@ -410,6 +413,7 @@ async def test_distributed_tracing_with_sampling_true(app_tracer, aiohttp_client
410413
assert 1 == span.get_metric(SAMPLING_PRIORITY_KEY)
411414

412415

416+
@flaky(1735812000)
413417
async def test_distributed_tracing_with_sampling_false(app_tracer, aiohttp_client):
414418
app, tracer = app_tracer
415419
client = await aiohttp_client(app)
@@ -460,6 +464,7 @@ async def test_distributed_tracing_disabled(app_tracer, aiohttp_client):
460464
assert span.parent_id != 42
461465

462466

467+
@flaky(1735812000)
463468
async def test_distributed_tracing_sub_span(app_tracer, aiohttp_client):
464469
app, tracer = app_tracer
465470
client = await aiohttp_client(app)
@@ -524,6 +529,7 @@ def _assert_200_parenting(client, traces):
524529
assert 0 == inner_span.error
525530

526531

532+
@flaky(1735812000)
527533
async def test_parenting_200_dd(app_tracer, aiohttp_client):
528534
app, tracer = app_tracer
529535
client = await aiohttp_client(app)
@@ -537,6 +543,7 @@ async def test_parenting_200_dd(app_tracer, aiohttp_client):
537543
_assert_200_parenting(client, traces)
538544

539545

546+
@flaky(1735812000)
540547
async def test_parenting_200_ot(app_tracer, aiohttp_client):
541548
"""OpenTracing version of test_handler."""
542549
app, tracer = app_tracer
@@ -553,6 +560,7 @@ async def test_parenting_200_ot(app_tracer, aiohttp_client):
553560
_assert_200_parenting(client, traces)
554561

555562

563+
@flaky(1735812000)
556564
async def test_analytics_integration_enabled(app_tracer, aiohttp_client):
557565
"""Check trace has analytics sample rate set"""
558566
app, tracer = app_tracer
@@ -567,6 +575,7 @@ async def test_analytics_integration_enabled(app_tracer, aiohttp_client):
567575
root.assert_structure(dict(name="aiohttp.request", metrics={ANALYTICS_SAMPLE_RATE_KEY: 0.5}))
568576

569577

578+
@flaky(1735812000)
570579
async def test_analytics_integration_default(app_tracer, aiohttp_client):
571580
"""Check trace has analytics sample rate set"""
572581
app, tracer = app_tracer
@@ -579,6 +588,7 @@ async def test_analytics_integration_default(app_tracer, aiohttp_client):
579588
assert root.get_metric(ANALYTICS_SAMPLE_RATE_KEY) is None
580589

581590

591+
@flaky(1735812000)
582592
async def test_analytics_integration_disabled(app_tracer, aiohttp_client):
583593
"""Check trace has analytics sample rate set"""
584594
app, tracer = app_tracer

tests/contrib/httpx/test_httpx.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ async def test():
190190
asyncio.run(test())
191191

192192

193+
@flaky(1735812000)
193194
@pytest.mark.subprocess(env=dict(DD_SERVICE="global-service-name"))
194195
def test_schematized_configure_global_service_name_env_default():
195196
"""

tests/contrib/kafka/test_kafka.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ def test_message(producer, consumer, tombstone, kafka_topic):
251251
message = consumer.poll(1.0)
252252

253253

254+
@flaky(1735812000)
254255
@pytest.mark.snapshot(ignores=["metrics.kafka.message_offset"])
255256
def test_commit(producer, consumer, kafka_topic):
256257
producer.produce(kafka_topic, PAYLOAD, key=KEY)
@@ -261,6 +262,7 @@ def test_commit(producer, consumer, kafka_topic):
261262
consumer.commit(message)
262263

263264

265+
@flaky(1735812000)
264266
@pytest.mark.snapshot(ignores=["metrics.kafka.message_offset"])
265267
def test_commit_with_offset(producer, consumer, kafka_topic):
266268
producer.produce(kafka_topic, PAYLOAD, key=KEY)
@@ -521,6 +523,7 @@ def test():
521523
assert err == b"", err.decode()
522524

523525

526+
@flaky(1735812000)
524527
def test_data_streams_kafka_offset_monitoring_messages(dsm_processor, non_auto_commit_consumer, producer, kafka_topic):
525528
def _read_single_message(consumer):
526529
message = None
@@ -553,6 +556,7 @@ def _read_single_message(consumer):
553556
assert list(buckets.values())[0].latest_commit_offsets[ConsumerPartitionKey("test_group", kafka_topic, 0)] == 1
554557

555558

559+
@flaky(1735812000)
556560
def test_data_streams_kafka_offset_monitoring_offsets(dsm_processor, non_auto_commit_consumer, producer, kafka_topic):
557561
def _read_single_message(consumer):
558562
message = None

tests/contrib/redis/test_redis_asyncio.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def test_patching():
6565
assert not isinstance(redis.asyncio.client.Pipeline.pipeline, ObjectProxy)
6666

6767

68+
@flaky(1735812000)
6869
@pytest.mark.asyncio
6970
@pytest.mark.snapshot(wait_for_num_traces=1)
7071
async def test_basic_request(redis_client):
@@ -165,6 +166,7 @@ async def test_pipeline_traced(redis_client):
165166
assert response_list[3].decode() == "bar"
166167

167168

169+
@flaky(1735812000)
168170
@pytest.mark.asyncio
169171
@pytest.mark.snapshot(wait_for_num_traces=1)
170172
async def test_pipeline_traced_context_manager_transaction(redis_client):

tests/contrib/vertica/test_vertica.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from tests.utils import DummyTracer
1818
from tests.utils import TracerTestCase
1919
from tests.utils import assert_is_measured
20+
from tests.utils import flaky
2021

2122

2223
TEST_TABLE = "test_table"
@@ -59,6 +60,7 @@ def tearDown(self):
5960
super(TestVerticaPatching, self).tearDown()
6061
unpatch()
6162

63+
@flaky(1735812000)
6264
def test_patch_after_import(self):
6365
"""Patching _after_ the import will not work because we hook into
6466
the module import system.

tests/opentelemetry/test_span.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from tests.utils import flaky
1616

1717

18-
@pytest.mark.snapshot
18+
@pytest.mark.snapshot(wait_for_num_traces=2)
1919
def test_otel_span_attributes(oteltracer):
2020
with oteltracer.start_span("otel-string-tags") as span1:
2121
span1.set_attribute("service.name", "moons-service-str")

tests/opentelemetry/test_trace.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_otel_compatible_tracer_is_returned_by_tracer_provider():
1717
assert isinstance(otel_compatible_tracer, opentelemetry.trace.Tracer)
1818

1919

20-
@pytest.mark.snapshot
20+
@pytest.mark.snapshot(wait_for_num_traces=1)
2121
def test_otel_start_span_with_default_args(oteltracer):
2222
otel_span = oteltracer.start_span("test-start-span")
2323
with pytest.raises(Exception, match="Sorry Otel Span, I failed you"):
@@ -37,8 +37,7 @@ def test_otel_start_span_with_default_args(oteltracer):
3737
otel_span.end()
3838

3939

40-
@flaky(1735812000)
41-
@pytest.mark.snapshot
40+
@pytest.mark.snapshot(wait_for_num_traces=1)
4241
def test_otel_start_span_without_default_args(oteltracer):
4342
root = oteltracer.start_span("root-span")
4443
otel_span = oteltracer.start_span(

0 commit comments

Comments
 (0)