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

chore: skip failing urlib3 ASM test #11861

Merged
merged 3 commits into from
Jan 8, 2025
Merged
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
8 changes: 8 additions & 0 deletions tests/contrib/urllib3/test_urllib3.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from ddtrace.ext import http
from ddtrace.internal.schema import DEFAULT_SPAN_SERVICE_NAME
from ddtrace.pin import Pin
from ddtrace.settings.asm import config as asm_config
from tests.contrib.config import HTTPBIN_CONFIG
from tests.opentracer.utils import init_tracer
from tests.utils import TracerTestCase
Expand Down Expand Up @@ -527,12 +528,16 @@ def test_distributed_tracing_disabled(self):
timeout=mock.ANY,
)

@pytest.mark.skip(reason="urlib3 does not set the ASM Manual keep tag so x-datadog headers are not propagated")
def test_distributed_tracing_apm_opt_out_true(self):
"""Tests distributed tracing headers are passed by default"""
# Check that distributed tracing headers are passed down; raise an error rather than make the
# request since we don't care about the response at all
config.urllib3["distributed_tracing"] = True
self.tracer.enabled = False
# Ensure the ASM SpanProcessor is set
self.tracer.configure(appsec_standalone_enabled=True, appsec_enabled=True)
assert asm_config._apm_opt_out
with mock.patch(
"urllib3.connectionpool.HTTPConnectionPool._make_request", side_effect=ValueError
) as m_make_request:
Expand Down Expand Up @@ -580,6 +585,9 @@ def test_distributed_tracing_apm_opt_out_false(self):
"""Test with distributed tracing disabled does not propagate the headers"""
config.urllib3["distributed_tracing"] = True
self.tracer.enabled = False
# Ensure the ASM SpanProcessor is set.
self.tracer.configure(appsec_standalone_enabled=False, appsec_enabled=True)
assert not asm_config._apm_opt_out
with mock.patch(
"urllib3.connectionpool.HTTPConnectionPool._make_request", side_effect=ValueError
) as m_make_request:
Expand Down
Loading