From b44af68b1d485522f7926cc7795eb7880fb2e156 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 70f6e5bd02..5609f21f9d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: 7054b534404fc69199e368cbe62a4e7570cc46ea + CORE_REPO_SHA: 622d5507708bdb961cf25a48f26a87592b05c356 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..0248f41fe7 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..0c56ac5baf 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)