Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(requests): fix local test runs #10769

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 6 additions & 4 deletions tests/contrib/requests/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down
Loading