From b0a2f1a4327613dd62dd08852c1b7712f5a1ab5e Mon Sep 17 00:00:00 2001 From: Munir Abdinur Date: Mon, 23 Sep 2024 22:34:16 -0400 Subject: [PATCH] chore(requests): fix local test runs update docker-compose to match gitlab restrictions --- docker-compose.yml | 2 +- tests/contrib/requests/test_requests.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2a5b4ee61bb..d1d7ecd094c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -175,7 +175,7 @@ services: - "${TMPDIR:-/var/lib/localstack}:/var/lib/localstack" - "/var/run/docker.sock:/var/run/docker.sock" - httpbin_local: + httpbin-local: image: kennethreitz/httpbin@sha256:2c7abc4803080c22928265744410173b6fea3b898872c01c5fd0f0f9df4a59fb platform: linux/amd64 ports: diff --git a/tests/contrib/requests/test_requests.py b/tests/contrib/requests/test_requests.py index 44b2f067087..ba78c0a4747 100644 --- a/tests/contrib/requests/test_requests.py +++ b/tests/contrib/requests/test_requests.py @@ -24,7 +24,7 @@ from tests.utils import override_global_tracer -HOST_AND_PORT = "httpbin-local:8001" +HOST_AND_PORT = "localhost:8001" SOCKET = HOST_AND_PORT.split(":")[0] URL_200 = "http://{}/status/200".format(HOST_AND_PORT) URL_500 = "http://{}/status/500".format(HOST_AND_PORT) @@ -243,9 +243,11 @@ def test_non_existant_url(self): assert s.get_tag("span.kind") == "client" assert s.get_tag("out.host") == "doesnotexist.google.com" assert s.error == 1 - assert "Name or service not known" in s.get_tag(ERROR_MSG) - assert "Name or service not known" in s.get_tag(ERROR_STACK) - assert "Traceback (most recent call last)" in s.get_tag(ERROR_STACK) + assert ( + "HTTPConnectionPool(host='doesnotexist.google.com', port=80): Max retries exceeded with url: /" + in s.get_tag(ERROR_MSG) + ) + assert s.get_tag(ERROR_STACK) assert "requests.exception" in s.get_tag(ERROR_TYPE) def test_500(self):