From e51cce2a10035b75f7c5d29a3ba8f0a630921ea3 Mon Sep 17 00:00:00 2001 From: Owais Lone Date: Sun, 4 Apr 2021 04:30:12 +0530 Subject: [PATCH] Account for ProxyTracerProvider Updated tests that relied on unset tracer being a noop tracer instead of a proxy tracer --- .github/workflows/test.yml | 2 +- .../tests/test_requests_integration.py | 4 +--- .../tests/test_urllib_integration.py | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0ff8a0a820..f7998cd114 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: 1a12fa0d681e37c1fda9cb8d46212ff3bbf6b76a + CORE_REPO_SHA: 94bf80f3870bceefa72d9a61353eaf5d7dd30993 jobs: build: diff --git a/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py b/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py index ecc56b7c54..16bfdafc97 100644 --- a/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py +++ b/instrumentation/opentelemetry-instrumentation-requests/tests/test_requests_integration.py @@ -177,10 +177,8 @@ def test_suppress_instrumentation(self): def test_not_recording(self): with mock.patch("opentelemetry.trace.INVALID_SPAN") as mock_span: RequestsInstrumentor().uninstrument() - # original_tracer_provider returns a default tracer provider, which - # in turn will return an INVALID_SPAN, which is always not recording RequestsInstrumentor().instrument( - tracer_provider=self.original_tracer_provider + tracer_provider=trace._DefaultTracerProvider() ) mock_span.is_recording.return_value = False result = self.perform_request(self.URL) diff --git a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py index e5a1092689..563e3a6db0 100644 --- a/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py +++ b/instrumentation/opentelemetry-instrumentation-urllib/tests/test_urllib_integration.py @@ -208,10 +208,8 @@ def test_suppress_instrumentation(self): def test_not_recording(self): with mock.patch("opentelemetry.trace.INVALID_SPAN") as mock_span: URLLibInstrumentor().uninstrument() - # original_tracer_provider returns a default tracer provider, which - # in turn will return an INVALID_SPAN, which is always not recording URLLibInstrumentor().instrument( - tracer_provider=self.original_tracer_provider + tracer_provider=trace._DefaultTracerProvider() ) mock_span.is_recording.return_value = False result = self.perform_request(self.URL)