diff --git a/instrumentation-genai/opentelemetry-instrumentation-google-genai/CHANGELOG.md b/instrumentation-genai/opentelemetry-instrumentation-google-genai/CHANGELOG.md index 909390f97..7bf6429c8 100644 --- a/instrumentation-genai/opentelemetry-instrumentation-google-genai/CHANGELOG.md +++ b/instrumentation-genai/opentelemetry-instrumentation-google-genai/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +- Skip the `test_e2e.py` workaround for [kevin1024/vcrpy#927](https://github.com/kevin1024/vcrpy/issues/927) on vcrpy releases that include [kevin1024/vcrpy#1055](https://github.com/kevin1024/vcrpy/pull/1055), where it breaks replaying ([#276](https://github.com/alibaba/loongsuite-python/pull/276)). + ## Version 0.7b0 (2026-02-20) - Fix bug in how tokens are counted when using the streaming `generateContent` method. ([#4152](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4152)). - Add `gen_ai.tool.definitions` attribute to `gen_ai.client.inference.operation.details` log event ([#4142](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4142)). diff --git a/instrumentation-genai/opentelemetry-instrumentation-google-genai/tests/generate_content/test_e2e.py b/instrumentation-genai/opentelemetry-instrumentation-google-genai/tests/generate_content/test_e2e.py index 47abf4b87..660362d39 100644 --- a/instrumentation-genai/opentelemetry-instrumentation-google-genai/tests/generate_content/test_e2e.py +++ b/instrumentation-genai/opentelemetry-instrumentation-google-genai/tests/generate_content/test_e2e.py @@ -42,9 +42,11 @@ try: # These modules are only supported in python >= 3.10 + from aiohttp import StreamReader from aiohttp.client_exceptions import ClientConnectionError from vcr.stubs import aiohttp_stubs except ImportError: + StreamReader = None ClientConnectionError = None aiohttp_stubs = None @@ -334,6 +336,12 @@ def fixture_patch_vcr_aiohttp_stream(): # https://github.com/kevin1024/vcrpy/issues/927 if ClientConnectionError is None or aiohttp_stubs is None: return + # vcrpy releases that include https://github.com/kevin1024/vcrpy/pull/1055 + # fix this themselves: a replayed response keeps a single aiohttp + # StreamReader as its content. The patch below is not needed there, and + # would break replaying. + if issubclass(aiohttp_stubs.MockStream, StreamReader): + return class _ReplayMockStream(aiohttp_stubs.MockStream): # Keep vcrpy's stream behavior, but ignore aiohttp's