Skip to content

Commit 694efff

Browse files
add asserts that traceparent is present on any request
1 parent af32995 commit 694efff

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

ext/opentelemetry-ext-aiohttp-client/tests/test_aiohttp_client_integration.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ def _http_request(
7171
"""Helper to start an aiohttp test server and send an actual HTTP request to it."""
7272

7373
async def do_request():
74-
async def default_handler(unused_request):
74+
async def default_handler(request):
75+
assert 'traceparent' in request.headers
7576
return aiohttp.web.Response(status=int(status_code))
7677

7778
handler = request_handler or default_handler
@@ -281,7 +282,8 @@ async def do_request(url):
281282
self.memory_exporter.clear()
282283

283284
def test_timeout(self):
284-
async def request_handler(unused_request):
285+
async def request_handler(request):
286+
assert 'traceparent' in request.headers
285287
await asyncio.sleep(1)
286288
return aiohttp.web.Response()
287289

@@ -312,6 +314,7 @@ def test_too_many_redirects(self):
312314
async def request_handler(request):
313315
# Create a redirect loop.
314316
location = request.url
317+
assert 'traceparent' in request.headers
315318
raise aiohttp.web.HTTPFound(location=location)
316319

317320
host, port = self._http_request(

0 commit comments

Comments
 (0)