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

Broken httpx tests locally #2821

Closed
xrmx opened this issue Aug 25, 2024 · 0 comments · Fixed by #2822
Closed

Broken httpx tests locally #2821

xrmx opened this issue Aug 25, 2024 · 0 comments · Fixed by #2822
Labels
bug Something isn't working

Comments

@xrmx
Copy link
Contributor

xrmx commented Aug 25, 2024

Describe your environment

OS: (e.g, Ubuntu)
Python version: (e.g., Python 3.8.10) 3.11
Package version: (e.g., 0.46.0) latest main

What happened?

httpx tests does not pass

Steps to Reproduce

tox -e py311-test-instrumentation-httpx-1

Expected Result

Green tests

Actual Result

_________________ TestSyncInstrumentationIntegration.test_instrument_client_with_proxy _________________

self = <tests.test_httpx_integration.TestSyncInstrumentationIntegration testMethod=test_instrument_client_with_proxy>

    def test_instrument_client_with_proxy(self):
        proxy_mounts = self.create_proxy_mounts()
        client = self.create_client(mounts=proxy_mounts)
>       self.assert_proxy_mounts(
            client._mounts.values(),
            2,
            (httpx.HTTPTransport, httpx.AsyncHTTPTransport),
        )

instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py:978: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py:758: in assert_proxy_mounts
    self.assertEqual(len(mounts), num_mounts)
E   AssertionError: 5 != 2
_______________________ TestSyncInstrumentationIntegration.test_instrument_proxy _______________________

self = <tests.test_httpx_integration.TestSyncInstrumentationIntegration testMethod=test_instrument_proxy>

    def test_instrument_proxy(self):
        proxy_mounts = self.create_proxy_mounts()
        HTTPXClientInstrumentor().instrument()
        client = self.create_client(mounts=proxy_mounts)
        self.perform_request(self.URL, client=client)
        self.assert_span(num_spans=1)
>       self.assert_proxy_mounts(
            client._mounts.values(),
            2,
            (SyncOpenTelemetryTransport, AsyncOpenTelemetryTransport),
        )

instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py:968: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py:758: in assert_proxy_mounts
    self.assertEqual(len(mounts), num_mounts)
E   AssertionError: 5 != 2
________________ TestSyncInstrumentationIntegration.test_uninstrument_client_with_proxy ________________

self = <tests.test_httpx_integration.TestSyncInstrumentationIntegration testMethod=test_uninstrument_client_with_proxy>

    def test_uninstrument_client_with_proxy(self):
        proxy_mounts = self.create_proxy_mounts()
        HTTPXClientInstrumentor().instrument()
        client = self.create_client(mounts=proxy_mounts)
>       self.assert_proxy_mounts(
            client._mounts.values(),
            2,
            (SyncOpenTelemetryTransport, AsyncOpenTelemetryTransport),
        )

instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py:998: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py:758: in assert_proxy_mounts
    self.assertEqual(len(mounts), num_mounts)
E   AssertionError: 5 != 2
________________ TestAsyncInstrumentationIntegration.test_instrument_client_with_proxy _________________

self = <tests.test_httpx_integration.TestAsyncInstrumentationIntegration testMethod=test_instrument_client_with_proxy>

    def test_instrument_client_with_proxy(self):
        proxy_mounts = self.create_proxy_mounts()
        client = self.create_client(mounts=proxy_mounts)
>       self.assert_proxy_mounts(
            client._mounts.values(),
            2,
            (httpx.HTTPTransport, httpx.AsyncHTTPTransport),
        )

instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py:978: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py:758: in assert_proxy_mounts
    self.assertEqual(len(mounts), num_mounts)
E   AssertionError: 5 != 2
______________________ TestAsyncInstrumentationIntegration.test_instrument_proxy _______________________

self = <tests.test_httpx_integration.TestAsyncInstrumentationIntegration testMethod=test_instrument_proxy>

    def test_instrument_proxy(self):
        proxy_mounts = self.create_proxy_mounts()
        HTTPXClientInstrumentor().instrument()
        client = self.create_client(mounts=proxy_mounts)
        self.perform_request(self.URL, client=client)
        self.assert_span(num_spans=1)
>       self.assert_proxy_mounts(
            client._mounts.values(),
            2,
            (SyncOpenTelemetryTransport, AsyncOpenTelemetryTransport),
        )

instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py:968: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py:758: in assert_proxy_mounts
    self.assertEqual(len(mounts), num_mounts)
E   AssertionError: 5 != 2
_______________ TestAsyncInstrumentationIntegration.test_uninstrument_client_with_proxy ________________

self = <tests.test_httpx_integration.TestAsyncInstrumentationIntegration testMethod=test_uninstrument_client_with_proxy>

    def test_uninstrument_client_with_proxy(self):
        proxy_mounts = self.create_proxy_mounts()
        HTTPXClientInstrumentor().instrument()
        client = self.create_client(mounts=proxy_mounts)
>       self.assert_proxy_mounts(
            client._mounts.values(),
            2,
            (SyncOpenTelemetryTransport, AsyncOpenTelemetryTransport),
        )

instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py:998: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py:758: in assert_proxy_mounts
    self.assertEqual(len(mounts), num_mounts)
E   AssertionError: 5 != 2

Additional context

No response

Would you like to implement a fix?

Yes

@xrmx xrmx added the bug Something isn't working label Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant