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

ci: Faster and smarter backup/restore tests #3516

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

BYK
Copy link
Member

@BYK BYK commented Jan 9, 2025

No description provided.

Copy link

codecov bot commented Jan 9, 2025

❌ 6 Tests Failed:

Tests completed Failed Passed Skipped
11 6 5 0
View the top 3 failed tests by shortest run time
_integration-test.test_run::test_asset_internal_rewrite
Stack Traces | 0.052s run time
#x1B[0m#x1B[37m@contextlib#x1B[39;49;00m.contextmanager
    #x1B[94mdef#x1B[39;49;00m #x1B[92mmap_httpcore_exceptions#x1B[39;49;00m() -> typing.Iterator[#x1B[94mNone#x1B[39;49;00m]:
        #x1B[94mglobal#x1B[39;49;00m HTTPCORE_EXC_MAP
        #x1B[94mif#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(HTTPCORE_EXC_MAP) == #x1B[94m0#x1B[39;49;00m:
            HTTPCORE_EXC_MAP = _load_httpcore_exceptions()
        #x1B[94mtry#x1B[39;49;00m:
>           #x1B[94myield#x1B[39;49;00m

#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpx/_transports/default.py#x1B[0m:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpx/_transports/default.py#x1B[0m:250: in handle_request
    #x1B[0mresp = #x1B[96mself#x1B[39;49;00m._pool.handle_request(req)
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpcore/_sync/connection_pool.py#x1B[0m:256: in handle_request
    #x1B[0m#x1B[94mraise#x1B[39;49;00m exc #x1B[94mfrom#x1B[39;49;00m #x1B[96mNone#x1B[39;49;00m
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpcore/_sync/connection_pool.py#x1B[0m:236: in handle_request
    #x1B[0mresponse = connection.handle_request(
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpcore/_sync/connection.py#x1B[0m:101: in handle_request
    #x1B[0m#x1B[94mraise#x1B[39;49;00m exc
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpcore/_sync/connection.py#x1B[0m:78: in handle_request
    #x1B[0mstream = #x1B[96mself#x1B[39;49;00m._connect(request)
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpcore/_sync/connection.py#x1B[0m:124: in _connect
    #x1B[0mstream = #x1B[96mself#x1B[39;49;00m._network_backend.connect_tcp(**kwargs)
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpcore/_backends/sync.py#x1B[0m:207: in connect_tcp
    #x1B[0m#x1B[94mwith#x1B[39;49;00m map_exceptions(exc_map):
#x1B[1m#x1B[.../usr/lib/python3.10/contextlib.py#x1B[0m:153: in __exit__
    #x1B[0m#x1B[96mself#x1B[39;49;00m.gen.throw(typ, value, traceback)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

map = {<class 'TimeoutError'>: <class 'httpcore.ConnectTimeout'>, <class 'OSError'>: <class 'httpcore.ConnectError'>}

    #x1B[0m#x1B[37m@contextlib#x1B[39;49;00m.contextmanager
    #x1B[94mdef#x1B[39;49;00m #x1B[92mmap_exceptions#x1B[39;49;00m(#x1B[96mmap#x1B[39;49;00m: ExceptionMapping) -> typing.Iterator[#x1B[94mNone#x1B[39;49;00m]:
        #x1B[94mtry#x1B[39;49;00m:
            #x1B[94myield#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mException#x1B[39;49;00m #x1B[94mas#x1B[39;49;00m exc:  #x1B[90m# noqa: PIE786#x1B[39;49;00m
            #x1B[94mfor#x1B[39;49;00m from_exc, to_exc #x1B[95min#x1B[39;49;00m #x1B[96mmap#x1B[39;49;00m.items():
                #x1B[94mif#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(exc, from_exc):
>                   #x1B[94mraise#x1B[39;49;00m to_exc(exc) #x1B[94mfrom#x1B[39;49;00m #x1B[04m#x1B[96mexc#x1B[39;49;00m
#x1B[1m#x1B[31mE                   httpcore.ConnectError: [Errno 111] Connection refused#x1B[0m

#x1B[1m#x1B[31m../../../.local/lib/python3.10.../site-packages/httpcore/_exceptions.py#x1B[0m:14: ConnectError

#x1B[33mThe above exception was the direct cause of the following exception:#x1B[0m

    #x1B[0m#x1B[94mdef#x1B[39;49;00m #x1B[92mtest_asset_internal_rewrite#x1B[39;49;00m():
        #x1B[33m"""Tests whether we correctly map `/_assets/*` to `.../_static/dist/sentry` as#x1B[39;49;00m
    #x1B[33m    we don't have a CDN setup in self-hosted."""#x1B[39;49;00m
>       response = httpx.get(#x1B[33mf#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m{#x1B[39;49;00mSENTRY_TEST_HOST#x1B[33m}#x1B[39;49;00m#x1B[.../_assets/entrypoints/app.js#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m)

#x1B[1m#x1B[31m_integration-test/test_run.py#x1B[0m:86: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m../../../.local/lib/python3.10....../site-packages/httpx/_api.py#x1B[0m:195: in get
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m request(
#x1B[1m#x1B[31m../../../.local/lib/python3.10....../site-packages/httpx/_api.py#x1B[0m:109: in request
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m client.request(
#x1B[1m#x1B[31m../../../.local/lib/python3.10.............../site-packages/httpx/_client.py#x1B[0m:825: in request
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.send(request, auth=auth, follow_redirects=follow_redirects)
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../site-packages/sentry_sdk/utils.py#x1B[0m:1858: in runner
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m original_function(*args, **kwargs)
#x1B[1m#x1B[31m../../../.local/lib/python3.10.............../site-packages/httpx/_client.py#x1B[0m:914: in send
    #x1B[0mresponse = #x1B[96mself#x1B[39;49;00m._send_handling_auth(
#x1B[1m#x1B[31m../../../.local/lib/python3.10.............../site-packages/httpx/_client.py#x1B[0m:942: in _send_handling_auth
    #x1B[0mresponse = #x1B[96mself#x1B[39;49;00m._send_handling_redirects(
#x1B[1m#x1B[31m../../../.local/lib/python3.10.............../site-packages/httpx/_client.py#x1B[0m:979: in _send_handling_redirects
    #x1B[0mresponse = #x1B[96mself#x1B[39;49;00m._send_single_request(request)
#x1B[1m#x1B[31m../../../.local/lib/python3.10.............../site-packages/httpx/_client.py#x1B[0m:1014: in _send_single_request
    #x1B[0mresponse = transport.handle_request(request)
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpx/_transports/default.py#x1B[0m:249: in handle_request
    #x1B[0m#x1B[94mwith#x1B[39;49;00m map_httpcore_exceptions():
#x1B[1m#x1B[.../usr/lib/python3.10/contextlib.py#x1B[0m:153: in __exit__
    #x1B[0m#x1B[96mself#x1B[39;49;00m.gen.throw(typ, value, traceback)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    #x1B[0m#x1B[37m@contextlib#x1B[39;49;00m.contextmanager
    #x1B[94mdef#x1B[39;49;00m #x1B[92mmap_httpcore_exceptions#x1B[39;49;00m() -> typing.Iterator[#x1B[94mNone#x1B[39;49;00m]:
        #x1B[94mglobal#x1B[39;49;00m HTTPCORE_EXC_MAP
        #x1B[94mif#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(HTTPCORE_EXC_MAP) == #x1B[94m0#x1B[39;49;00m:
            HTTPCORE_EXC_MAP = _load_httpcore_exceptions()
        #x1B[94mtry#x1B[39;49;00m:
            #x1B[94myield#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mException#x1B[39;49;00m #x1B[94mas#x1B[39;49;00m exc:
            mapped_exc = #x1B[94mNone#x1B[39;49;00m
    
            #x1B[94mfor#x1B[39;49;00m from_exc, to_exc #x1B[95min#x1B[39;49;00m HTTPCORE_EXC_MAP.items():
                #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(exc, from_exc):
                    #x1B[94mcontinue#x1B[39;49;00m
                #x1B[90m# We want to map to the most specific exception we can find.#x1B[39;49;00m
                #x1B[90m# Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to#x1B[39;49;00m
                #x1B[90m# `httpx.ReadTimeout`, not just `httpx.TimeoutException`.#x1B[39;49;00m
                #x1B[94mif#x1B[39;49;00m mapped_exc #x1B[95mis#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m #x1B[95mor#x1B[39;49;00m #x1B[96missubclass#x1B[39;49;00m(to_exc, mapped_exc):
                    mapped_exc = to_exc
    
            #x1B[94mif#x1B[39;49;00m mapped_exc #x1B[95mis#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m:  #x1B[90m# pragma: no cover#x1B[39;49;00m
                #x1B[94mraise#x1B[39;49;00m
    
            message = #x1B[96mstr#x1B[39;49;00m(exc)
>           #x1B[94mraise#x1B[39;49;00m mapped_exc(message) #x1B[94mfrom#x1B[39;49;00m #x1B[04m#x1B[96mexc#x1B[39;49;00m
#x1B[1m#x1B[31mE           httpx.ConnectError: [Errno 111] Connection refused#x1B[0m

#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpx/_transports/default.py#x1B[0m:118: ConnectError
_integration-test.test_run::test_login
Stack Traces | 0.052s run time
#x1B[0m#x1B[37m@contextlib#x1B[39;49;00m.contextmanager
    #x1B[94mdef#x1B[39;49;00m #x1B[92mmap_httpcore_exceptions#x1B[39;49;00m() -> typing.Iterator[#x1B[94mNone#x1B[39;49;00m]:
        #x1B[94mglobal#x1B[39;49;00m HTTPCORE_EXC_MAP
        #x1B[94mif#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(HTTPCORE_EXC_MAP) == #x1B[94m0#x1B[39;49;00m:
            HTTPCORE_EXC_MAP = _load_httpcore_exceptions()
        #x1B[94mtry#x1B[39;49;00m:
>           #x1B[94myield#x1B[39;49;00m

#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpx/_transports/default.py#x1B[0m:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpx/_transports/default.py#x1B[0m:250: in handle_request
    #x1B[0mresp = #x1B[96mself#x1B[39;49;00m._pool.handle_request(req)
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpcore/_sync/connection_pool.py#x1B[0m:256: in handle_request
    #x1B[0m#x1B[94mraise#x1B[39;49;00m exc #x1B[94mfrom#x1B[39;49;00m #x1B[96mNone#x1B[39;49;00m
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpcore/_sync/connection_pool.py#x1B[0m:236: in handle_request
    #x1B[0mresponse = connection.handle_request(
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpcore/_sync/connection.py#x1B[0m:101: in handle_request
    #x1B[0m#x1B[94mraise#x1B[39;49;00m exc
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpcore/_sync/connection.py#x1B[0m:78: in handle_request
    #x1B[0mstream = #x1B[96mself#x1B[39;49;00m._connect(request)
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpcore/_sync/connection.py#x1B[0m:124: in _connect
    #x1B[0mstream = #x1B[96mself#x1B[39;49;00m._network_backend.connect_tcp(**kwargs)
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpcore/_backends/sync.py#x1B[0m:207: in connect_tcp
    #x1B[0m#x1B[94mwith#x1B[39;49;00m map_exceptions(exc_map):
#x1B[1m#x1B[.../usr/lib/python3.10/contextlib.py#x1B[0m:153: in __exit__
    #x1B[0m#x1B[96mself#x1B[39;49;00m.gen.throw(typ, value, traceback)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

map = {<class 'TimeoutError'>: <class 'httpcore.ConnectTimeout'>, <class 'OSError'>: <class 'httpcore.ConnectError'>}

    #x1B[0m#x1B[37m@contextlib#x1B[39;49;00m.contextmanager
    #x1B[94mdef#x1B[39;49;00m #x1B[92mmap_exceptions#x1B[39;49;00m(#x1B[96mmap#x1B[39;49;00m: ExceptionMapping) -> typing.Iterator[#x1B[94mNone#x1B[39;49;00m]:
        #x1B[94mtry#x1B[39;49;00m:
            #x1B[94myield#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mException#x1B[39;49;00m #x1B[94mas#x1B[39;49;00m exc:  #x1B[90m# noqa: PIE786#x1B[39;49;00m
            #x1B[94mfor#x1B[39;49;00m from_exc, to_exc #x1B[95min#x1B[39;49;00m #x1B[96mmap#x1B[39;49;00m.items():
                #x1B[94mif#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(exc, from_exc):
>                   #x1B[94mraise#x1B[39;49;00m to_exc(exc) #x1B[94mfrom#x1B[39;49;00m #x1B[04m#x1B[96mexc#x1B[39;49;00m
#x1B[1m#x1B[31mE                   httpcore.ConnectError: [Errno 111] Connection refused#x1B[0m

#x1B[1m#x1B[31m../../../.local/lib/python3.10.../site-packages/httpcore/_exceptions.py#x1B[0m:14: ConnectError

#x1B[33mThe above exception was the direct cause of the following exception:#x1B[0m

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.fixture()
    #x1B[94mdef#x1B[39;49;00m #x1B[92mclient_login#x1B[39;49;00m():
        client = httpx.Client()
>       response = client.get(SENTRY_TEST_HOST, follow_redirects=#x1B[94mTrue#x1B[39;49;00m)

#x1B[1m#x1B[31m_integration-test/test_run.py#x1B[0m:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m../../../.local/lib/python3.10................../site-packages/httpx/_client.py#x1B[0m:1053: in get
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.request(
#x1B[1m#x1B[31m../../../.local/lib/python3.10................../site-packages/httpx/_client.py#x1B[0m:825: in request
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.send(request, auth=auth, follow_redirects=follow_redirects)
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../site-packages/sentry_sdk/utils.py#x1B[0m:1858: in runner
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m original_function(*args, **kwargs)
#x1B[1m#x1B[31m../../../.local/lib/python3.10................../site-packages/httpx/_client.py#x1B[0m:914: in send
    #x1B[0mresponse = #x1B[96mself#x1B[39;49;00m._send_handling_auth(
#x1B[1m#x1B[31m../../../.local/lib/python3.10................../site-packages/httpx/_client.py#x1B[0m:942: in _send_handling_auth
    #x1B[0mresponse = #x1B[96mself#x1B[39;49;00m._send_handling_redirects(
#x1B[1m#x1B[31m../../../.local/lib/python3.10................../site-packages/httpx/_client.py#x1B[0m:979: in _send_handling_redirects
    #x1B[0mresponse = #x1B[96mself#x1B[39;49;00m._send_single_request(request)
#x1B[1m#x1B[31m../../../.local/lib/python3.10................../site-packages/httpx/_client.py#x1B[0m:1014: in _send_single_request
    #x1B[0mresponse = transport.handle_request(request)
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpx/_transports/default.py#x1B[0m:249: in handle_request
    #x1B[0m#x1B[94mwith#x1B[39;49;00m map_httpcore_exceptions():
#x1B[1m#x1B[.../usr/lib/python3.10/contextlib.py#x1B[0m:153: in __exit__
    #x1B[0m#x1B[96mself#x1B[39;49;00m.gen.throw(typ, value, traceback)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    #x1B[0m#x1B[37m@contextlib#x1B[39;49;00m.contextmanager
    #x1B[94mdef#x1B[39;49;00m #x1B[92mmap_httpcore_exceptions#x1B[39;49;00m() -> typing.Iterator[#x1B[94mNone#x1B[39;49;00m]:
        #x1B[94mglobal#x1B[39;49;00m HTTPCORE_EXC_MAP
        #x1B[94mif#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(HTTPCORE_EXC_MAP) == #x1B[94m0#x1B[39;49;00m:
            HTTPCORE_EXC_MAP = _load_httpcore_exceptions()
        #x1B[94mtry#x1B[39;49;00m:
            #x1B[94myield#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mException#x1B[39;49;00m #x1B[94mas#x1B[39;49;00m exc:
            mapped_exc = #x1B[94mNone#x1B[39;49;00m
    
            #x1B[94mfor#x1B[39;49;00m from_exc, to_exc #x1B[95min#x1B[39;49;00m HTTPCORE_EXC_MAP.items():
                #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(exc, from_exc):
                    #x1B[94mcontinue#x1B[39;49;00m
                #x1B[90m# We want to map to the most specific exception we can find.#x1B[39;49;00m
                #x1B[90m# Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to#x1B[39;49;00m
                #x1B[90m# `httpx.ReadTimeout`, not just `httpx.TimeoutException`.#x1B[39;49;00m
                #x1B[94mif#x1B[39;49;00m mapped_exc #x1B[95mis#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m #x1B[95mor#x1B[39;49;00m #x1B[96missubclass#x1B[39;49;00m(to_exc, mapped_exc):
                    mapped_exc = to_exc
    
            #x1B[94mif#x1B[39;49;00m mapped_exc #x1B[95mis#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m:  #x1B[90m# pragma: no cover#x1B[39;49;00m
                #x1B[94mraise#x1B[39;49;00m
    
            message = #x1B[96mstr#x1B[39;49;00m(exc)
>           #x1B[94mraise#x1B[39;49;00m mapped_exc(message) #x1B[94mfrom#x1B[39;49;00m #x1B[04m#x1B[96mexc#x1B[39;49;00m
#x1B[1m#x1B[31mE           httpx.ConnectError: [Errno 111] Connection refused#x1B[0m

#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpx/_transports/default.py#x1B[0m:118: ConnectError
_integration-test.test_run::test_receive_event
Stack Traces | 0.052s run time
#x1B[0m#x1B[37m@contextlib#x1B[39;49;00m.contextmanager
    #x1B[94mdef#x1B[39;49;00m #x1B[92mmap_httpcore_exceptions#x1B[39;49;00m() -> typing.Iterator[#x1B[94mNone#x1B[39;49;00m]:
        #x1B[94mglobal#x1B[39;49;00m HTTPCORE_EXC_MAP
        #x1B[94mif#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(HTTPCORE_EXC_MAP) == #x1B[94m0#x1B[39;49;00m:
            HTTPCORE_EXC_MAP = _load_httpcore_exceptions()
        #x1B[94mtry#x1B[39;49;00m:
>           #x1B[94myield#x1B[39;49;00m

#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpx/_transports/default.py#x1B[0m:101: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpx/_transports/default.py#x1B[0m:250: in handle_request
    #x1B[0mresp = #x1B[96mself#x1B[39;49;00m._pool.handle_request(req)
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpcore/_sync/connection_pool.py#x1B[0m:256: in handle_request
    #x1B[0m#x1B[94mraise#x1B[39;49;00m exc #x1B[94mfrom#x1B[39;49;00m #x1B[96mNone#x1B[39;49;00m
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpcore/_sync/connection_pool.py#x1B[0m:236: in handle_request
    #x1B[0mresponse = connection.handle_request(
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpcore/_sync/connection.py#x1B[0m:101: in handle_request
    #x1B[0m#x1B[94mraise#x1B[39;49;00m exc
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpcore/_sync/connection.py#x1B[0m:78: in handle_request
    #x1B[0mstream = #x1B[96mself#x1B[39;49;00m._connect(request)
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpcore/_sync/connection.py#x1B[0m:124: in _connect
    #x1B[0mstream = #x1B[96mself#x1B[39;49;00m._network_backend.connect_tcp(**kwargs)
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpcore/_backends/sync.py#x1B[0m:207: in connect_tcp
    #x1B[0m#x1B[94mwith#x1B[39;49;00m map_exceptions(exc_map):
#x1B[1m#x1B[.../usr/lib/python3.10/contextlib.py#x1B[0m:153: in __exit__
    #x1B[0m#x1B[96mself#x1B[39;49;00m.gen.throw(typ, value, traceback)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

map = {<class 'TimeoutError'>: <class 'httpcore.ConnectTimeout'>, <class 'OSError'>: <class 'httpcore.ConnectError'>}

    #x1B[0m#x1B[37m@contextlib#x1B[39;49;00m.contextmanager
    #x1B[94mdef#x1B[39;49;00m #x1B[92mmap_exceptions#x1B[39;49;00m(#x1B[96mmap#x1B[39;49;00m: ExceptionMapping) -> typing.Iterator[#x1B[94mNone#x1B[39;49;00m]:
        #x1B[94mtry#x1B[39;49;00m:
            #x1B[94myield#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mException#x1B[39;49;00m #x1B[94mas#x1B[39;49;00m exc:  #x1B[90m# noqa: PIE786#x1B[39;49;00m
            #x1B[94mfor#x1B[39;49;00m from_exc, to_exc #x1B[95min#x1B[39;49;00m #x1B[96mmap#x1B[39;49;00m.items():
                #x1B[94mif#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(exc, from_exc):
>                   #x1B[94mraise#x1B[39;49;00m to_exc(exc) #x1B[94mfrom#x1B[39;49;00m #x1B[04m#x1B[96mexc#x1B[39;49;00m
#x1B[1m#x1B[31mE                   httpcore.ConnectError: [Errno 111] Connection refused#x1B[0m

#x1B[1m#x1B[31m../../../.local/lib/python3.10.../site-packages/httpcore/_exceptions.py#x1B[0m:14: ConnectError

#x1B[33mThe above exception was the direct cause of the following exception:#x1B[0m

    #x1B[0m#x1B[37m@pytest#x1B[39;49;00m.fixture()
    #x1B[94mdef#x1B[39;49;00m #x1B[92mclient_login#x1B[39;49;00m():
        client = httpx.Client()
>       response = client.get(SENTRY_TEST_HOST, follow_redirects=#x1B[94mTrue#x1B[39;49;00m)

#x1B[1m#x1B[31m_integration-test/test_run.py#x1B[0m:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
#x1B[1m#x1B[31m../../../.local/lib/python3.10................../site-packages/httpx/_client.py#x1B[0m:1053: in get
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.request(
#x1B[1m#x1B[31m../../../.local/lib/python3.10................../site-packages/httpx/_client.py#x1B[0m:825: in request
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m #x1B[96mself#x1B[39;49;00m.send(request, auth=auth, follow_redirects=follow_redirects)
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../site-packages/sentry_sdk/utils.py#x1B[0m:1858: in runner
    #x1B[0m#x1B[94mreturn#x1B[39;49;00m original_function(*args, **kwargs)
#x1B[1m#x1B[31m../../../.local/lib/python3.10................../site-packages/httpx/_client.py#x1B[0m:914: in send
    #x1B[0mresponse = #x1B[96mself#x1B[39;49;00m._send_handling_auth(
#x1B[1m#x1B[31m../../../.local/lib/python3.10................../site-packages/httpx/_client.py#x1B[0m:942: in _send_handling_auth
    #x1B[0mresponse = #x1B[96mself#x1B[39;49;00m._send_handling_redirects(
#x1B[1m#x1B[31m../../../.local/lib/python3.10................../site-packages/httpx/_client.py#x1B[0m:979: in _send_handling_redirects
    #x1B[0mresponse = #x1B[96mself#x1B[39;49;00m._send_single_request(request)
#x1B[1m#x1B[31m../../../.local/lib/python3.10................../site-packages/httpx/_client.py#x1B[0m:1014: in _send_single_request
    #x1B[0mresponse = transport.handle_request(request)
#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpx/_transports/default.py#x1B[0m:249: in handle_request
    #x1B[0m#x1B[94mwith#x1B[39;49;00m map_httpcore_exceptions():
#x1B[1m#x1B[.../usr/lib/python3.10/contextlib.py#x1B[0m:153: in __exit__
    #x1B[0m#x1B[96mself#x1B[39;49;00m.gen.throw(typ, value, traceback)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    #x1B[0m#x1B[37m@contextlib#x1B[39;49;00m.contextmanager
    #x1B[94mdef#x1B[39;49;00m #x1B[92mmap_httpcore_exceptions#x1B[39;49;00m() -> typing.Iterator[#x1B[94mNone#x1B[39;49;00m]:
        #x1B[94mglobal#x1B[39;49;00m HTTPCORE_EXC_MAP
        #x1B[94mif#x1B[39;49;00m #x1B[96mlen#x1B[39;49;00m(HTTPCORE_EXC_MAP) == #x1B[94m0#x1B[39;49;00m:
            HTTPCORE_EXC_MAP = _load_httpcore_exceptions()
        #x1B[94mtry#x1B[39;49;00m:
            #x1B[94myield#x1B[39;49;00m
        #x1B[94mexcept#x1B[39;49;00m #x1B[96mException#x1B[39;49;00m #x1B[94mas#x1B[39;49;00m exc:
            mapped_exc = #x1B[94mNone#x1B[39;49;00m
    
            #x1B[94mfor#x1B[39;49;00m from_exc, to_exc #x1B[95min#x1B[39;49;00m HTTPCORE_EXC_MAP.items():
                #x1B[94mif#x1B[39;49;00m #x1B[95mnot#x1B[39;49;00m #x1B[96misinstance#x1B[39;49;00m(exc, from_exc):
                    #x1B[94mcontinue#x1B[39;49;00m
                #x1B[90m# We want to map to the most specific exception we can find.#x1B[39;49;00m
                #x1B[90m# Eg if `exc` is an `httpcore.ReadTimeout`, we want to map to#x1B[39;49;00m
                #x1B[90m# `httpx.ReadTimeout`, not just `httpx.TimeoutException`.#x1B[39;49;00m
                #x1B[94mif#x1B[39;49;00m mapped_exc #x1B[95mis#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m #x1B[95mor#x1B[39;49;00m #x1B[96missubclass#x1B[39;49;00m(to_exc, mapped_exc):
                    mapped_exc = to_exc
    
            #x1B[94mif#x1B[39;49;00m mapped_exc #x1B[95mis#x1B[39;49;00m #x1B[94mNone#x1B[39;49;00m:  #x1B[90m# pragma: no cover#x1B[39;49;00m
                #x1B[94mraise#x1B[39;49;00m
    
            message = #x1B[96mstr#x1B[39;49;00m(exc)
>           #x1B[94mraise#x1B[39;49;00m mapped_exc(message) #x1B[94mfrom#x1B[39;49;00m #x1B[04m#x1B[96mexc#x1B[39;49;00m
#x1B[1m#x1B[31mE           httpx.ConnectError: [Errno 111] Connection refused#x1B[0m

#x1B[1m#x1B[31m../../../.local/lib/python3.10.../httpx/_transports/default.py#x1B[0m:118: ConnectError

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant