Running with gitlab-runner 17.7.0 (3153ccc6)
  on Heavy runner on DO CsXVDUbD, system ID: s_a30377c9ccd3
section_start:1735811869:prepare_executor
Preparing the "docker+machine" executor
Using Docker executor with image python:3.10 ...
Pulling docker image python:3.10 ...
Using docker image sha256:ab7315e562dd57b151abd96bdcb16abc8b9f41a5942f3e5669877a3fd40c4969 for python:3.10 with digest python@sha256:81b81c80d41ec59dcee2c373b8e1d73a0b6949df793db1b043a033ca6837e02d ...
section_end:1735811998:prepare_executor
section_start:1735811998:prepare_script
Preparing environment
Running on runner-csxvdubd-project-6813-concurrent-0 via runner-csxvdubd-apertis-heavy-1735811869-2c9b09e7...
section_end:1735811999:prepare_script
section_start:1735811999:get_sources
Getting source from Git repository
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/infrastructure/obs-proxy/.git/
Created fresh repository.
Checking out 28f32a57 as detached HEAD (ref is py-3.12-13-test)...

Skipping Git submodules setup
section_end:1735812000:get_sources
section_start:1735812000:step_script
Executing "step_script" stage of the job script
Using docker image sha256:ab7315e562dd57b151abd96bdcb16abc8b9f41a5942f3e5669877a3fd40c4969 for python:3.10 with digest python@sha256:81b81c80d41ec59dcee2c373b8e1d73a0b6949df793db1b043a033ca6837e02d ...
$ pip install .[test]
Processing /builds/infrastructure/obs-proxy
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: setuptools in /usr/local/lib/python3.10/site-packages (from obs-proxy==0) (65.5.1)
Collecting bidict~=0.18
  Downloading bidict-0.23.1-py3-none-any.whl (32 kB)
Collecting httpx~=0.22
  Downloading httpx-0.28.1-py3-none-any.whl (73 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 73.5/73.5 kB 7.2 MB/s eta 0:00:00
Collecting json-rpc~=1.12
  Downloading json_rpc-1.15.0-py2.py3-none-any.whl (39 kB)
Collecting Quart~=0.18
  Downloading quart-0.20.0-py3-none-any.whl (77 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.0/78.0 kB 10.6 MB/s eta 0:00:00
Collecting Werkzeug~=2.3
  Downloading werkzeug-2.3.8-py3-none-any.whl (242 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 242.3/242.3 kB 24.0 MB/s eta 0:00:00
Collecting websockets~=10.0
  Downloading websockets-10.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (106 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 106.8/106.8 kB 9.4 MB/s eta 0:00:00
Collecting xmltodict~=0.13
  Downloading xmltodict-0.14.2-py2.py3-none-any.whl (10.0 kB)
Collecting aiofiles~=0.8
  Downloading aiofiles-0.8.0-py3-none-any.whl (13 kB)
Collecting jinja2~=3.0.0
  Downloading Jinja2-3.0.3-py3-none-any.whl (133 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.6/133.6 kB 15.2 MB/s eta 0:00:00
Collecting structlog~=22.3
  Downloading structlog-22.3.0-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.7/61.7 kB 4.0 MB/s eta 0:00:00
Collecting rich
  Downloading rich-13.9.4-py3-none-any.whl (242 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 242.4/242.4 kB 7.5 MB/s eta 0:00:00
Collecting pytest>=6
  Downloading pytest-8.3.4-py3-none-any.whl (343 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 343.1/343.1 kB 22.6 MB/s eta 0:00:00
Collecting pytest-asyncio>=0.17
  Downloading pytest_asyncio-0.25.1-py3-none-any.whl (19 kB)
Collecting pytest-httpx>=0.20
  Downloading pytest_httpx-0.35.0-py3-none-any.whl (19 kB)
Collecting certifi
  Downloading certifi-2024.12.14-py3-none-any.whl (164 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 164.9/164.9 kB 21.1 MB/s eta 0:00:00
Collecting httpcore==1.*
  Downloading httpcore-1.0.7-py3-none-any.whl (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.6/78.6 kB 11.5 MB/s eta 0:00:00
Collecting anyio
  Downloading anyio-4.7.0-py3-none-any.whl (93 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 93.1/93.1 kB 12.8 MB/s eta 0:00:00
Collecting idna
  Downloading idna-3.10-py3-none-any.whl (70 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 70.4/70.4 kB 11.0 MB/s eta 0:00:00
Collecting h11<0.15,>=0.13
  Downloading h11-0.14.0-py3-none-any.whl (58 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.3/58.3 kB 2.5 MB/s eta 0:00:00
Collecting MarkupSafe>=2.0
  Downloading MarkupSafe-3.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (20 kB)
Collecting pluggy<2,>=1.5
  Downloading pluggy-1.5.0-py3-none-any.whl (20 kB)
Collecting packaging
  Downloading packaging-24.2-py3-none-any.whl (65 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.5/65.5 kB 9.5 MB/s eta 0:00:00
Collecting exceptiongroup>=1.0.0rc8
  Downloading exceptiongroup-1.2.2-py3-none-any.whl (16 kB)
Collecting tomli>=1
  Downloading tomli-2.2.1-py3-none-any.whl (14 kB)
Collecting iniconfig
  Downloading iniconfig-2.0.0-py3-none-any.whl (5.9 kB)
Collecting Quart~=0.18
  Downloading quart-0.19.9-py3-none-any.whl (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.3/78.3 kB 7.4 MB/s eta 0:00:00
  Downloading quart-0.19.8-py3-none-any.whl (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.3/78.3 kB 6.3 MB/s eta 0:00:00
  Downloading quart-0.19.7-py3-none-any.whl (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.3/78.3 kB 11.4 MB/s eta 0:00:00
  Downloading quart-0.19.6-py3-none-any.whl (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.2/78.2 kB 3.0 MB/s eta 0:00:00
  Downloading quart-0.19.5-py3-none-any.whl (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.1/78.1 kB 11.7 MB/s eta 0:00:00
  Downloading quart-0.19.4-py3-none-any.whl (77 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.8/77.8 kB 7.9 MB/s eta 0:00:00
  Downloading quart-0.19.3-py3-none-any.whl (77 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.9/77.9 kB 11.8 MB/s eta 0:00:00
  Downloading quart-0.19.2-py3-none-any.whl (77 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.9/77.9 kB 10.8 MB/s eta 0:00:00
  Downloading quart-0.19.1-py3-none-any.whl (77 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.7/77.7 kB 5.9 MB/s eta 0:00:00
  Downloading quart-0.19.0-py3-none-any.whl (77 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.0/78.0 kB 11.2 MB/s eta 0:00:00
  Downloading quart-0.18.4-py3-none-any.whl (100 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.2/100.2 kB 8.0 MB/s eta 0:00:00
Collecting click>=8.0.0
  Downloading click-8.1.8-py3-none-any.whl (98 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 98.2/98.2 kB 9.3 MB/s eta 0:00:00
Collecting blinker<1.6
  Downloading blinker-1.5-py2.py3-none-any.whl (12 kB)
Collecting itsdangerous
  Downloading itsdangerous-2.2.0-py3-none-any.whl (16 kB)
Collecting hypercorn>=0.11.2
  Downloading hypercorn-0.17.3-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.7/61.7 kB 4.2 MB/s eta 0:00:00
Collecting typing-extensions<5.0,>=4.0.0
  Downloading typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Collecting markdown-it-py>=2.2.0
  Downloading markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 87.5/87.5 kB 5.6 MB/s eta 0:00:00
Collecting pygments<3.0.0,>=2.13.0
  Downloading pygments-2.18.0-py3-none-any.whl (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 46.7 MB/s eta 0:00:00
Collecting h2>=3.1.0
  Downloading h2-4.1.0-py3-none-any.whl (57 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.5/57.5 kB 7.1 MB/s eta 0:00:00
Collecting wsproto>=0.14.0
  Downloading wsproto-1.2.0-py3-none-any.whl (24 kB)
Collecting taskgroup
  Downloading taskgroup-0.2.1-py2.py3-none-any.whl (13 kB)
Collecting priority
  Downloading priority-2.0.0-py3-none-any.whl (8.9 kB)
Collecting mdurl~=0.1
  Downloading mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Collecting sniffio>=1.1
  Downloading sniffio-1.3.1-py3-none-any.whl (10 kB)
Collecting hyperframe<7,>=6.0
  Downloading hyperframe-6.0.1-py3-none-any.whl (12 kB)
Collecting hpack<5,>=4.0
  Downloading hpack-4.0.0-py3-none-any.whl (32 kB)
Building wheels for collected packages: obs-proxy
  Building wheel for obs-proxy (setup.py): started
  Building wheel for obs-proxy (setup.py): finished with status 'done'
  Created wheel for obs-proxy: filename=obs_proxy-0-py3-none-any.whl size=37794 sha256=d3ca9481bdac827309df86df4cce66e11cc2f5e88d2756510349a185f3835159
  Stored in directory: /root/.cache/pip/wheels/07/c8/51/060da547a076a33cf8a97f42a2e595d67472f778e6640ba61f
Successfully built obs-proxy
Installing collected packages: json-rpc, xmltodict, websockets, typing-extensions, tomli, structlog, sniffio, pygments, priority, pluggy, packaging, mdurl, MarkupSafe, itsdangerous, iniconfig, idna, hyperframe, hpack, h11, exceptiongroup, click, certifi, blinker, bidict, aiofiles, wsproto, Werkzeug, taskgroup, pytest, markdown-it-py, jinja2, httpcore, h2, anyio, rich, pytest-asyncio, hypercorn, httpx, Quart, pytest-httpx, obs-proxy
Successfully installed MarkupSafe-3.0.2 Quart-0.18.4 Werkzeug-2.3.8 aiofiles-0.8.0 anyio-4.7.0 bidict-0.23.1 blinker-1.5 certifi-2024.12.14 click-8.1.8 exceptiongroup-1.2.2 h11-0.14.0 h2-4.1.0 hpack-4.0.0 httpcore-1.0.7 httpx-0.28.1 hypercorn-0.17.3 hyperframe-6.0.1 idna-3.10 iniconfig-2.0.0 itsdangerous-2.2.0 jinja2-3.0.3 json-rpc-1.15.0 markdown-it-py-3.0.0 mdurl-0.1.2 obs-proxy-0 packaging-24.2 pluggy-1.5.0 priority-2.0.0 pygments-2.18.0 pytest-8.3.4 pytest-asyncio-0.25.1 pytest-httpx-0.35.0 rich-13.9.4 sniffio-1.3.1 structlog-22.3.0 taskgroup-0.2.1 tomli-2.2.1 typing-extensions-4.12.2 websockets-10.4 wsproto-1.2.0 xmltodict-0.14.2
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip is available: 23.0.1 -> 24.3.1
[notice] To update, run: pip install --upgrade pip
$ python setup.py build sdist bdist
/usr/local/lib/python3.10/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
  warnings.warn(msg, warning_class)
running build
running build_py
running sdist
running egg_info
writing obs_proxy.egg-info/PKG-INFO
writing dependency_links to obs_proxy.egg-info/dependency_links.txt
writing entry points to obs_proxy.egg-info/entry_points.txt
writing requirements to obs_proxy.egg-info/requires.txt
writing top-level names to obs_proxy.egg-info/top_level.txt
reading manifest file 'obs_proxy.egg-info/SOURCES.txt'
adding license file 'COPYING.MPL'
writing manifest file 'obs_proxy.egg-info/SOURCES.txt'
running check
creating obs-proxy-0
creating obs-proxy-0/obs_proxy
creating obs-proxy-0/obs_proxy.egg-info
creating obs-proxy-0/obs_proxy/chunked_uploads
copying files to obs-proxy-0...
copying COPYING.MPL -> obs-proxy-0
copying README.md -> obs-proxy-0
copying proxy.conf -> obs-proxy-0
copying setup.cfg -> obs-proxy-0
copying setup.py -> obs-proxy-0
copying obs_proxy/__init__.py -> obs-proxy-0/obs_proxy
copying obs_proxy/async_jsonrpc.py -> obs-proxy-0/obs_proxy
copying obs_proxy/client.py -> obs-proxy-0/obs_proxy
copying obs_proxy/config.py -> obs-proxy-0/obs_proxy
copying obs_proxy/repserver.py -> obs-proxy-0/obs_proxy
copying obs_proxy/rpcqueue.py -> obs-proxy-0/obs_proxy
copying obs_proxy/server.py -> obs-proxy-0/obs_proxy
copying obs_proxy/utils.py -> obs-proxy-0/obs_proxy
copying obs_proxy/worker.py -> obs-proxy-0/obs_proxy
copying obs_proxy/wsclient.py -> obs-proxy-0/obs_proxy
copying obs_proxy.egg-info/PKG-INFO -> obs-proxy-0/obs_proxy.egg-info
copying obs_proxy.egg-info/SOURCES.txt -> obs-proxy-0/obs_proxy.egg-info
copying obs_proxy.egg-info/dependency_links.txt -> obs-proxy-0/obs_proxy.egg-info
copying obs_proxy.egg-info/entry_points.txt -> obs-proxy-0/obs_proxy.egg-info
copying obs_proxy.egg-info/requires.txt -> obs-proxy-0/obs_proxy.egg-info
copying obs_proxy.egg-info/top_level.txt -> obs-proxy-0/obs_proxy.egg-info
copying obs_proxy/chunked_uploads/__init__.py -> obs-proxy-0/obs_proxy/chunked_uploads
copying obs_proxy/chunked_uploads/client.py -> obs-proxy-0/obs_proxy/chunked_uploads
copying obs_proxy/chunked_uploads/routes.py -> obs-proxy-0/obs_proxy/chunked_uploads
copying obs_proxy/chunked_uploads/utils.py -> obs-proxy-0/obs_proxy/chunked_uploads
Writing obs-proxy-0/setup.cfg
creating dist
Creating tar archive
removing 'obs-proxy-0' (and everything under it)
running bdist
running bdist_dumb
installing to build/bdist.linux-x86_64/dumb
running install
/usr/local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running install_lib
creating build/bdist.linux-x86_64/dumb
creating build/bdist.linux-x86_64/dumb/usr
creating build/bdist.linux-x86_64/dumb/usr/local
creating build/bdist.linux-x86_64/dumb/usr/local/lib
creating build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10
creating build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages
creating build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy
copying build/lib/obs_proxy/server.py -> build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy
creating build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy/chunked_uploads
copying build/lib/obs_proxy/chunked_uploads/client.py -> build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy/chunked_uploads
copying build/lib/obs_proxy/chunked_uploads/utils.py -> build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy/chunked_uploads
copying build/lib/obs_proxy/chunked_uploads/__init__.py -> build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy/chunked_uploads
copying build/lib/obs_proxy/chunked_uploads/routes.py -> build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy/chunked_uploads
copying build/lib/obs_proxy/worker.py -> build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy
copying build/lib/obs_proxy/rpcqueue.py -> build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy
copying build/lib/obs_proxy/repserver.py -> build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy
copying build/lib/obs_proxy/wsclient.py -> build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy
copying build/lib/obs_proxy/config.py -> build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy
copying build/lib/obs_proxy/async_jsonrpc.py -> build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy
copying build/lib/obs_proxy/client.py -> build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy
copying build/lib/obs_proxy/utils.py -> build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy
copying build/lib/obs_proxy/__init__.py -> build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy
byte-compiling build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy/server.py to server.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy/chunked_uploads/client.py to client.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy/chunked_uploads/utils.py to utils.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy/chunked_uploads/__init__.py to __init__.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy/chunked_uploads/routes.py to routes.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy/worker.py to worker.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy/rpcqueue.py to rpcqueue.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy/repserver.py to repserver.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy/wsclient.py to wsclient.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy/config.py to config.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy/async_jsonrpc.py to async_jsonrpc.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy/client.py to client.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy/utils.py to utils.cpython-310.pyc
byte-compiling build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy/__init__.py to __init__.cpython-310.pyc
running install_data
creating build/bdist.linux-x86_64/dumb/usr/local/share
creating build/bdist.linux-x86_64/dumb/usr/local/share/doc
creating build/bdist.linux-x86_64/dumb/usr/local/share/doc/obs-proxy
creating build/bdist.linux-x86_64/dumb/usr/local/share/doc/obs-proxy/examples
copying proxy.conf -> build/bdist.linux-x86_64/dumb/usr/local/share/doc/obs-proxy/examples
running install_egg_info
Copying obs_proxy.egg-info to build/bdist.linux-x86_64/dumb/usr/local/lib/python3.10/site-packages/obs_proxy-0-py3.10.egg-info
running install_scripts
Installing obs-proxy-client script to build/bdist.linux-x86_64/dumb/usr/local/bin
Installing obs-proxy-server script to build/bdist.linux-x86_64/dumb/usr/local/bin
Creating tar archive
removing 'build/bdist.linux-x86_64/dumb' (and everything under it)
$ pytest --junit-xml=test-results.xml -v
/usr/local/lib/python3.10/site-packages/pytest_asyncio/plugin.py:207: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the fixture caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to function scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
============================= test session starts ==============================
platform linux -- Python 3.10.16, pytest-8.3.4, pluggy-1.5.0 -- /usr/local/bin/python3.10
cachedir: .pytest_cache
rootdir: /builds/infrastructure/obs-proxy
configfile: setup.cfg
plugins: httpx-0.35.0, asyncio-0.25.1, anyio-4.7.0
asyncio: mode=auto, asyncio_default_fixture_loop_scope=None
collecting ... collected 30 items

obs_proxy/server.py::obs_proxy.server.proxied_uri PASSED                 [  3%]
obs_proxy/utils.py::obs_proxy.utils.shorten PASSED                       [  6%]
obs_proxy/worker.py::obs_proxy.worker.Worker.fromxml PASSED              [ 10%]
tests/chunked_uploads/test_upload_chunked.py::test_upload_chunked_timeout FAILED [ 13%]
tests/chunked_uploads/test_upload_chunked.py::test_upload_chunked_timeout ERROR [ 13%]
tests/chunked_uploads/test_upload_chunked.py::test_upload_chunked_wrong_response FAILED [ 16%]
tests/chunked_uploads/test_upload_chunked.py::test_upload_chunked_wrong_response ERROR [ 16%]
tests/chunked_uploads/test_upload_chunked.py::test_upload_chunked_transient_server_error FAILED [ 20%]
tests/chunked_uploads/test_upload_chunked.py::test_upload_chunked_transient_server_error ERROR [ 20%]
tests/chunked_uploads/test_upload_chunked.py::test_upload_chunked_complete FAILED [ 23%]
tests/chunked_uploads/test_upload_chunked.py::test_upload_chunked_complete ERROR [ 23%]
tests/chunked_uploads/test_upload_client_server.py::test_client_uploading_to_server PASSED [ 26%]
tests/chunked_uploads/test_upload_endpoint.py::test_smoke PASSED         [ 30%]
tests/chunked_uploads/test_upload_endpoint.py::test_invalid_jobid PASSED [ 33%]
tests/chunked_uploads/test_upload_endpoint.py::test_missing_content_length PASSED [ 36%]
tests/chunked_uploads/test_upload_endpoint.py::test_patch_range_parser[bytes 123-233/999-HTTPStatus.BAD_REQUEST-length must match] PASSED [ 40%]
tests/chunked_uploads/test_upload_endpoint.py::test_patch_range_parser[furlongs 123-233/999-HTTPStatus.BAD_REQUEST-Unsupported unit] PASSED [ 43%]
tests/chunked_uploads/test_upload_endpoint.py::test_patch_range_parser[*/0-HTTPStatus.BAD_REQUEST-A range is required] PASSED [ 46%]
tests/chunked_uploads/test_upload_endpoint.py::test_patch_sequential_upload PASSED [ 50%]
tests/chunked_uploads/test_upload_endpoint.py::test_patch_incomplete_upload PASSED [ 53%]
tests/test_auth.py::test_userpass PASSED                                 [ 56%]
tests/test_auth.py::test_token PASSED                                    [ 60%]
tests/test_config.py::test_config_parser PASSED                          [ 63%]
tests/test_config.py::test_config_parser_dict PASSED                     [ 66%]
tests/test_config.py::test_mini_config PASSED                            [ 70%]
tests/test_config.py::test_mini_config_update PASSED                     [ 73%]
tests/test_rpcqueue.py::test_rpcqueue PASSED                             [ 76%]
tests/upload/test_upload.py::test_upload_data_no_error PASSED            [ 80%]
tests/upload/test_upload.py::test_upload_data_req_error PASSED           [ 83%]
tests/upload/test_upload.py::test_upload_data_no_error_streaming PASSED  [ 86%]
tests/upload/test_upload_five_gigazeroes.py::test_getbinaries PASSED     [ 90%]
tests/upload/test_upload_five_gigazeroes.py::test_five_gigazero_upload PASSED [ 93%]
tests/upload/test_upload_prefix.py::test_getbinaries PASSED              [ 96%]
tests/upload/test_upload_prefix.py::test_five_kilozero_upload PASSED     [100%]

==================================== ERRORS ====================================
_______________ ERROR at teardown of test_upload_chunked_timeout _______________

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fbc55767610>
request = <SubRequest 'httpx_mock' for <Coroutine test_upload_chunked_timeout>>

    @pytest.fixture
    def httpx_mock(
        monkeypatch: MonkeyPatch,
        request: FixtureRequest,
    ) -> Generator[HTTPXMock, None, None]:
        options = {}
        for marker in request.node.iter_markers("httpx_mock"):
            options = marker.kwargs | options
        __tracebackhide__ = methodcaller("errisinstance", TypeError)
        options = _HTTPXMockOptions(**options)
    
        mock = HTTPXMock(options)
    
        # Mock synchronous requests
        real_handle_request = httpx.HTTPTransport.handle_request
    
        def mocked_handle_request(
            transport: httpx.HTTPTransport, request: httpx.Request
        ) -> httpx.Response:
            if options.should_mock(request):
                return mock._handle_request(transport, request)
            return real_handle_request(transport, request)
    
        monkeypatch.setattr(
            httpx.HTTPTransport,
            "handle_request",
            mocked_handle_request,
        )
    
        # Mock asynchronous requests
        real_handle_async_request = httpx.AsyncHTTPTransport.handle_async_request
    
        async def mocked_handle_async_request(
            transport: httpx.AsyncHTTPTransport, request: httpx.Request
        ) -> httpx.Response:
            if options.should_mock(request):
                return await mock._handle_async_request(transport, request)
            return await real_handle_async_request(transport, request)
    
        monkeypatch.setattr(
            httpx.AsyncHTTPTransport,
            "handle_async_request",
            mocked_handle_async_request,
        )
    
        yield mock
        try:
>           mock._assert_options()

/usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_httpx._httpx_mock.HTTPXMock object at 0x7fbc557677f0>

    def _assert_options(self) -> None:
        callbacks_not_executed = [
            matcher for matcher, _ in self._callbacks if matcher.should_have_matched()
        ]
        matchers_description = "\n".join(
            [f"- {matcher}" for matcher in callbacks_not_executed]
        )
    
>       assert not callbacks_not_executed, (
            "The following responses are mocked but not requested:\n"
            f"{matchers_description}\n"
            "\n"
            "If this is on purpose, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-more-responses-than-what-will-be-requested"
        )
E       AssertionError: The following responses are mocked but not requested:
E         - Match any request with {'Patch-Content-Range': 'bytes 2621440-3145727/4194304'} headers
E         
E         If this is on purpose, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-more-responses-than-what-will-be-requested
E       assert not [<pytest_httpx._request_matcher._RequestMatcher object at 0x7fbc55766e90>]

/usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:319: AssertionError
----------------------------- Captured stdout call -----------------------------
2025-01-02 10:00:20 [debug    ] patching                       attempt=0 content_range=<ContentRange 'bytes 0-524287/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:20 [debug    ] patch result                   result=<Response [200 OK]>
2025-01-02 10:00:20 [debug    ] patching                       attempt=0 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:20 [error    ] retrying                       attempt=0
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 0                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc557654b0>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc55765900> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = None                                                     │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc5586d4b0>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55765bd0>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55765bd0>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc557559c0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc557654b0>        │          │
│ │     start = 130.68963083                                        │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc557677f0>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc557676d0>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557677f0>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557677f0>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:21 [debug    ] patching                       attempt=1 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:21 [error    ] retrying                       attempt=1
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 1                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc557654b0>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc55765900> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc5586d4b0>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55587dc0>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55587dc0>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc55603f40>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc557654b0>        │          │
│ │     start = 131.957492107                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc557677f0>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc557676d0>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557677f0>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557677f0>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:22 [debug    ] patching                       attempt=2 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:22 [error    ] retrying                       attempt=2
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 2                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc557654b0>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc55765900> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc5586d4b0>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55f8ecb0>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55f8ecb0>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc55603e40>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc557654b0>        │          │
│ │     start = 133.071486882                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc557677f0>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc557676d0>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557677f0>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557677f0>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:23 [debug    ] patching                       attempt=3 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:23 [error    ] retrying                       attempt=3
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 3                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc557654b0>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc55765900> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc5586d4b0>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc558f63e0>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc558f63e0>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc55603ec0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc557654b0>        │          │
│ │     start = 134.129792548                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc557677f0>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc557676d0>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557677f0>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557677f0>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:25 [debug    ] patching                       attempt=4 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:25 [error    ] retrying                       attempt=4
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 4                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc557654b0>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc55765900> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc5586d4b0>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55d9b7c0>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55d9b7c0>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc55603f40>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc557654b0>        │          │
│ │     start = 135.192214438                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc557677f0>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc557676d0>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557677f0>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557677f0>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

___________ ERROR at teardown of test_upload_chunked_wrong_response ____________

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fbc54ae0ee0>
request = <SubRequest 'httpx_mock' for <Coroutine test_upload_chunked_wrong_response>>

    @pytest.fixture
    def httpx_mock(
        monkeypatch: MonkeyPatch,
        request: FixtureRequest,
    ) -> Generator[HTTPXMock, None, None]:
        options = {}
        for marker in request.node.iter_markers("httpx_mock"):
            options = marker.kwargs | options
        __tracebackhide__ = methodcaller("errisinstance", TypeError)
        options = _HTTPXMockOptions(**options)
    
        mock = HTTPXMock(options)
    
        # Mock synchronous requests
        real_handle_request = httpx.HTTPTransport.handle_request
    
        def mocked_handle_request(
            transport: httpx.HTTPTransport, request: httpx.Request
        ) -> httpx.Response:
            if options.should_mock(request):
                return mock._handle_request(transport, request)
            return real_handle_request(transport, request)
    
        monkeypatch.setattr(
            httpx.HTTPTransport,
            "handle_request",
            mocked_handle_request,
        )
    
        # Mock asynchronous requests
        real_handle_async_request = httpx.AsyncHTTPTransport.handle_async_request
    
        async def mocked_handle_async_request(
            transport: httpx.AsyncHTTPTransport, request: httpx.Request
        ) -> httpx.Response:
            if options.should_mock(request):
                return await mock._handle_async_request(transport, request)
            return await real_handle_async_request(transport, request)
    
        monkeypatch.setattr(
            httpx.AsyncHTTPTransport,
            "handle_async_request",
            mocked_handle_async_request,
        )
    
        yield mock
        try:
>           mock._assert_options()

/usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_httpx._httpx_mock.HTTPXMock object at 0x7fbc54ae0d30>

    def _assert_options(self) -> None:
        callbacks_not_executed = [
            matcher for matcher, _ in self._callbacks if matcher.should_have_matched()
        ]
        matchers_description = "\n".join(
            [f"- {matcher}" for matcher in callbacks_not_executed]
        )
    
>       assert not callbacks_not_executed, (
            "The following responses are mocked but not requested:\n"
            f"{matchers_description}\n"
            "\n"
            "If this is on purpose, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-more-responses-than-what-will-be-requested"
        )
E       AssertionError: The following responses are mocked but not requested:
E         - Match any request with {'Patch-Content-Range': 'bytes 2621440-3145727/4194304'} headers
E         
E         If this is on purpose, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-more-responses-than-what-will-be-requested
E       assert not [<pytest_httpx._request_matcher._RequestMatcher object at 0x7fbc54ae1f60>]

/usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:319: AssertionError
----------------------------- Captured stdout call -----------------------------
2025-01-02 10:00:26 [debug    ] patching                       attempt=0 content_range=<ContentRange 'bytes 0-524287/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:26 [debug    ] patch result                   result=<Response [200 OK]>
2025-01-02 10:00:26 [debug    ] patching                       attempt=0 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:26 [error    ] retrying                       attempt=0
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 0                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc54ae1f90>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc54ae3af0> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = None                                                     │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc555f45d0>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc54ae3820>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc54ae3820>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc54b2c6c0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc54ae1f90>        │          │
│ │     start = 136.453167555                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc54ae0d30>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc54ae0dc0>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54ae0d30>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54ae0d30>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:27 [debug    ] patching                       attempt=1 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:27 [error    ] retrying                       attempt=1
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 1                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc54ae1f90>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc54ae3af0> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc555f45d0>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc557b82b0>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc557b82b0>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc55603f40>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc54ae1f90>        │          │
│ │     start = 137.586904491                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc54ae0d30>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc54ae0dc0>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54ae0d30>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54ae0d30>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:28 [debug    ] patching                       attempt=2 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:28 [error    ] retrying                       attempt=2
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 2                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc54ae1f90>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc54ae3af0> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc555f45d0>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc5579fe80>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc5579fe80>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc55755640>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc54ae1f90>        │          │
│ │     start = 138.493519239                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc54ae0d30>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc54ae0dc0>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54ae0d30>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54ae0d30>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:29 [debug    ] patching                       attempt=3 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:29 [error    ] retrying                       attempt=3
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 3                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc54ae1f90>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc54ae3af0> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc555f45d0>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55966140>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55966140>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc557558c0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc54ae1f90>        │          │
│ │     start = 139.388829387                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc54ae0d30>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc54ae0dc0>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54ae0d30>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54ae0d30>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:30 [debug    ] patching                       attempt=4 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:30 [error    ] retrying                       attempt=4
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 4                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc54ae1f90>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc54ae3af0> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc555f45d0>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55966f80>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55966f80>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc557557c0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc54ae1f90>        │          │
│ │     start = 140.349997272                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc54ae0d30>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc54ae0dc0>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54ae0d30>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54ae0d30>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

_______ ERROR at teardown of test_upload_chunked_transient_server_error ________

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fbc557a2200>
request = <SubRequest 'httpx_mock' for <Coroutine test_upload_chunked_transient_server_error>>

    @pytest.fixture
    def httpx_mock(
        monkeypatch: MonkeyPatch,
        request: FixtureRequest,
    ) -> Generator[HTTPXMock, None, None]:
        options = {}
        for marker in request.node.iter_markers("httpx_mock"):
            options = marker.kwargs | options
        __tracebackhide__ = methodcaller("errisinstance", TypeError)
        options = _HTTPXMockOptions(**options)
    
        mock = HTTPXMock(options)
    
        # Mock synchronous requests
        real_handle_request = httpx.HTTPTransport.handle_request
    
        def mocked_handle_request(
            transport: httpx.HTTPTransport, request: httpx.Request
        ) -> httpx.Response:
            if options.should_mock(request):
                return mock._handle_request(transport, request)
            return real_handle_request(transport, request)
    
        monkeypatch.setattr(
            httpx.HTTPTransport,
            "handle_request",
            mocked_handle_request,
        )
    
        # Mock asynchronous requests
        real_handle_async_request = httpx.AsyncHTTPTransport.handle_async_request
    
        async def mocked_handle_async_request(
            transport: httpx.AsyncHTTPTransport, request: httpx.Request
        ) -> httpx.Response:
            if options.should_mock(request):
                return await mock._handle_async_request(transport, request)
            return await real_handle_async_request(transport, request)
    
        monkeypatch.setattr(
            httpx.AsyncHTTPTransport,
            "handle_async_request",
            mocked_handle_async_request,
        )
    
        yield mock
        try:
>           mock._assert_options()

/usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_httpx._httpx_mock.HTTPXMock object at 0x7fbc557a3b80>

    def _assert_options(self) -> None:
        callbacks_not_executed = [
            matcher for matcher, _ in self._callbacks if matcher.should_have_matched()
        ]
        matchers_description = "\n".join(
            [f"- {matcher}" for matcher in callbacks_not_executed]
        )
    
>       assert not callbacks_not_executed, (
            "The following responses are mocked but not requested:\n"
            f"{matchers_description}\n"
            "\n"
            "If this is on purpose, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-more-responses-than-what-will-be-requested"
        )
E       AssertionError: The following responses are mocked but not requested:
E         - Match any request with {'Patch-Content-Range': 'bytes 2621440-3145727/4194304'} headers
E         
E         If this is on purpose, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-more-responses-than-what-will-be-requested
E       assert not [<pytest_httpx._request_matcher._RequestMatcher object at 0x7fbc557a1570>]

/usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:319: AssertionError
----------------------------- Captured stdout call -----------------------------
2025-01-02 10:00:31 [debug    ] patching                       attempt=0 content_range=<ContentRange 'bytes 0-524287/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:31 [debug    ] patch result                   result=<Response [200 OK]>
2025-01-02 10:00:31 [debug    ] patching                       attempt=0 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:31 [error    ] retrying                       attempt=0
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 0                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc557a1f30>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc557a0e20> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = None                                                     │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc54baf330>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc557a14e0>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc557a14e0>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc54b2edc0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc557a1f30>        │          │
│ │     start = 141.568768411                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc557a3b80>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc557a0160>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557a3b80>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557a3b80>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:32 [debug    ] patching                       attempt=1 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:32 [error    ] retrying                       attempt=1
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 1                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc557a1f30>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc557a0e20> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc54baf330>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55df8b20>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55df8b20>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc547977c0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc557a1f30>        │          │
│ │     start = 142.614268669                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc557a3b80>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc557a0160>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557a3b80>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557a3b80>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:33 [debug    ] patching                       attempt=2 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:33 [error    ] retrying                       attempt=2
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 2                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc557a1f30>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc557a0e20> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc54baf330>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc557b8670>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc557b8670>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc55755640>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc557a1f30>        │          │
│ │     start = 143.712498183                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc557a3b80>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc557a0160>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557a3b80>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557a3b80>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:34 [debug    ] patching                       attempt=3 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:34 [error    ] retrying                       attempt=3
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 3                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc557a1f30>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc557a0e20> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc54baf330>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55d9b3d0>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55d9b3d0>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc557557c0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc557a1f30>        │          │
│ │     start = 144.969778418                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc557a3b80>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc557a0160>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557a3b80>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557a3b80>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:35 [debug    ] patching                       attempt=4 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:35 [error    ] retrying                       attempt=4
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 4                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc557a1f30>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc557a0e20> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc54baf330>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc557a14e0>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc557a14e0>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc557554c0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc557a1f30>        │          │
│ │     start = 146.075017585                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc557a3b80>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc557a0160>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557a3b80>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557a3b80>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

______________ ERROR at teardown of test_upload_chunked_complete _______________

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fbc54b45d80>
request = <SubRequest 'httpx_mock' for <Coroutine test_upload_chunked_complete>>

    @pytest.fixture
    def httpx_mock(
        monkeypatch: MonkeyPatch,
        request: FixtureRequest,
    ) -> Generator[HTTPXMock, None, None]:
        options = {}
        for marker in request.node.iter_markers("httpx_mock"):
            options = marker.kwargs | options
        __tracebackhide__ = methodcaller("errisinstance", TypeError)
        options = _HTTPXMockOptions(**options)
    
        mock = HTTPXMock(options)
    
        # Mock synchronous requests
        real_handle_request = httpx.HTTPTransport.handle_request
    
        def mocked_handle_request(
            transport: httpx.HTTPTransport, request: httpx.Request
        ) -> httpx.Response:
            if options.should_mock(request):
                return mock._handle_request(transport, request)
            return real_handle_request(transport, request)
    
        monkeypatch.setattr(
            httpx.HTTPTransport,
            "handle_request",
            mocked_handle_request,
        )
    
        # Mock asynchronous requests
        real_handle_async_request = httpx.AsyncHTTPTransport.handle_async_request
    
        async def mocked_handle_async_request(
            transport: httpx.AsyncHTTPTransport, request: httpx.Request
        ) -> httpx.Response:
            if options.should_mock(request):
                return await mock._handle_async_request(transport, request)
            return await real_handle_async_request(transport, request)
    
        monkeypatch.setattr(
            httpx.AsyncHTTPTransport,
            "handle_async_request",
            mocked_handle_async_request,
        )
    
        yield mock
        try:
>           mock._assert_options()

/usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_httpx._httpx_mock.HTTPXMock object at 0x7fbc54b46140>

    def _assert_options(self) -> None:
        callbacks_not_executed = [
            matcher for matcher, _ in self._callbacks if matcher.should_have_matched()
        ]
        matchers_description = "\n".join(
            [f"- {matcher}" for matcher in callbacks_not_executed]
        )
    
>       assert not callbacks_not_executed, (
            "The following responses are mocked but not requested:\n"
            f"{matchers_description}\n"
            "\n"
            "If this is on purpose, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-more-responses-than-what-will-be-requested"
        )
E       AssertionError: The following responses are mocked but not requested:
E         - Match HEAD request
E         
E         If this is on purpose, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-more-responses-than-what-will-be-requested
E       assert not [<pytest_httpx._request_matcher._RequestMatcher object at 0x7fbc54b461d0>]

/usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:319: AssertionError
----------------------------- Captured stdout call -----------------------------
2025-01-02 10:00:37 [debug    ] patching                       attempt=0 content_range=<ContentRange 'bytes 0-524287/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:37 [debug    ] patch result                   result=<Response [200 OK]>
2025-01-02 10:00:37 [debug    ] patching                       attempt=0 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:37 [error    ] retrying                       attempt=0
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 0                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc54b45570>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc54b45450> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Content-Length': '524288'} headers amongst:\n- Match   │ │
│ │                 HEAD request\n- Already matched any request with         │ │
│ │                 {'Content-Length': '524288'} headers\n\nIf you wanted to │ │
│ │                 reuse an already matched response instead of registering │ │
│ │                 it again, refer to                                       │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = None                                                     │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc547a5c50>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc54b44700>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc54b44700>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc54b2f140>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc54b45570>        │          │
│ │     start = 147.451462275                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc54b46140>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc54b44850>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54b46140>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54b46140>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Content-Length': '524288'} headers amongst:
- Match HEAD request
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:38 [debug    ] patching                       attempt=1 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:38 [error    ] retrying                       attempt=1
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 1                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc54b45570>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc54b45450> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Content-Length': '524288'} headers amongst:\n- Match   │ │
│ │                 HEAD request\n- Already matched any request with         │ │
│ │                 {'Content-Length': '524288'} headers\n\nIf you wanted to │ │
│ │                 reuse an already matched response instead of registering │ │
│ │                 it again, refer to                                       │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Content-Length': '524288'} headers amongst:\n- Match   │ │
│ │                 HEAD request\n- Already matched any request with         │ │
│ │                 {'Content-Length': '524288'} headers\n\nIf you wanted to │ │
│ │                 reuse an already matched response instead of registering │ │
│ │                 it again, refer to                                       │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc547a5c50>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55df8b20>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55df8b20>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc547958c0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc54b45570>        │          │
│ │     start = 148.678581962                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc54b46140>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc54b44850>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54b46140>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54b46140>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Content-Length': '524288'} headers amongst:
- Match HEAD request
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:39 [debug    ] patching                       attempt=2 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:39 [error    ] retrying                       attempt=2
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 2                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc54b45570>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc54b45450> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Content-Length': '524288'} headers amongst:\n- Match   │ │
│ │                 HEAD request\n- Already matched any request with         │ │
│ │                 {'Content-Length': '524288'} headers\n\nIf you wanted to │ │
│ │                 reuse an already matched response instead of registering │ │
│ │                 it again, refer to                                       │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Content-Length': '524288'} headers amongst:\n- Match   │ │
│ │                 HEAD request\n- Already matched any request with         │ │
│ │                 {'Content-Length': '524288'} headers\n\nIf you wanted to │ │
│ │                 reuse an already matched response instead of registering │ │
│ │                 it again, refer to                                       │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc547a5c50>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55d9b7c0>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55d9b7c0>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc557554c0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc54b45570>        │          │
│ │     start = 150.075674832                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc54b46140>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc54b44850>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54b46140>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54b46140>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Content-Length': '524288'} headers amongst:
- Match HEAD request
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:41 [debug    ] patching                       attempt=3 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:41 [error    ] retrying                       attempt=3
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 3                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc54b45570>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc54b45450> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Content-Length': '524288'} headers amongst:\n- Match   │ │
│ │                 HEAD request\n- Already matched any request with         │ │
│ │                 {'Content-Length': '524288'} headers\n\nIf you wanted to │ │
│ │                 reuse an already matched response instead of registering │ │
│ │                 it again, refer to                                       │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Content-Length': '524288'} headers amongst:\n- Match   │ │
│ │                 HEAD request\n- Already matched any request with         │ │
│ │                 {'Content-Length': '524288'} headers\n\nIf you wanted to │ │
│ │                 reuse an already matched response instead of registering │ │
│ │                 it again, refer to                                       │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc547a5c50>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc5579fe80>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc5579fe80>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc55755640>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc54b45570>        │          │
│ │     start = 151.185487242                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc54b46140>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc54b44850>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54b46140>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54b46140>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Content-Length': '524288'} headers amongst:
- Match HEAD request
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:41 [debug    ] patching                       attempt=4 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:41 [error    ] retrying                       attempt=4
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 4                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc54b45570>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc54b45450> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Content-Length': '524288'} headers amongst:\n- Match   │ │
│ │                 HEAD request\n- Already matched any request with         │ │
│ │                 {'Content-Length': '524288'} headers\n\nIf you wanted to │ │
│ │                 reuse an already matched response instead of registering │ │
│ │                 it again, refer to                                       │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Content-Length': '524288'} headers amongst:\n- Match   │ │
│ │                 HEAD request\n- Already matched any request with         │ │
│ │                 {'Content-Length': '524288'} headers\n\nIf you wanted to │ │
│ │                 reuse an already matched response instead of registering │ │
│ │                 it again, refer to                                       │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc547a5c50>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55f8e080>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55f8e080>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc547958c0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc54b45570>        │          │
│ │     start = 152.127313106                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc54b46140>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc54b44850>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54b46140>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54b46140>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Content-Length': '524288'} headers amongst:
- Match HEAD request
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

=================================== FAILURES ===================================
_________________________ test_upload_chunked_timeout __________________________

client = <httpx.AsyncClient object at 0x7fbc557654b0>
uri = 'http://example.org/upload'
data = <aiofiles.threadpool.binary.AsyncBufferedReader object at 0x7fbc55765900> wrapping <_io.BufferedReader name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_timeout0/tempfile'>
size = 4194304, chunk_size = 524288, headers = {}, kv = {}
content_range = <ContentRange 'bytes 524288-1048575/4194304'>, attempt = 4
file_hasher = <md5 _hashlib.HASH object @ 0x7fbc5586d4b0>
chunk_headers = {'Content-Length': '524288', 'Patch-Content-Range': 'bytes 524288-1048575/4194304'}
offset = 524288
chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
pos = 1048576

    async def upload_chunked(
            client: httpx.AsyncClient,
            uri: str,
            data: AsyncFileIO,
            size: int,
            chunk_size: int = UPLOAD_CHUNK_SIZE,
            headers=None,
            **kv,
    ):
        if not headers:
            headers = {}
    
        content_range = None
        attempt = 0
        file_hasher = hashlib.md5()
        try:
            chunk_headers = headers.copy()
            await data.seek(0)
            while True:
                offset = await data.tell()
                chunk = await data.read(chunk_size)
                if not chunk:
                    break
                pos = await data.tell()
    
                file_hasher.update(chunk)
    
                content_range = ContentRange(
                    start=offset,
                    stop=pos,
                    length=size,
                    units="bytes",
                )
                chunk_headers["Patch-Content-Range"] = content_range.to_header()
                chunk_headers["Content-Length"] = str(len(chunk))
                exc = None
                for attempt in range(MAX_ATTEMPTS):
                    try:
                        logger.debug("patching", uri=uri, size=len(chunk), content_range=content_range, attempt=attempt)
                        r = await client.patch(
                            uri,
                            content=chunk,
                            headers=chunk_headers,
                            **kv,
                        )
                        logger.debug("patch result", result=r)
                        if r.is_success:
                            break
                        else:
                            r.raise_for_status()
                    except httpx.HTTPStatusError as e:
                        if not e.response.is_server_error:
                            logger.debug("not server error, not retrying", resp=e.response)
                            raise
                        logger.exception("retrying", attempt=attempt)
                        exc = e
                    except httpx.HTTPError as e:
                        logger.exception("retrying", attempt=attempt)
                        exc = e
                else:
>                   raise exc

obs_proxy/chunked_uploads/client.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
obs_proxy/chunked_uploads/client.py:84: in upload_chunked
    r = await client.patch(
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1933: in patch
    return await self.request(
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1540: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1629: in send
    response = await self._send_handling_auth(
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1657: in _send_handling_auth
    response = await self._send_handling_redirects(
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1694: in _send_handling_redirects
    response = await self._send_single_request(request)
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1730: in _send_single_request
    response = await transport.handle_async_request(request)
/usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56: in mocked_handle_async_request
    return await mock._handle_async_request(transport, request)
/usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183: in _handle_async_request
    self._request_not_matched(real_transport, request)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_httpx._httpx_mock.HTTPXMock object at 0x7fbc557677f0>
real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>
request = <Request('PATCH', 'http://example.org/upload')>

    def _request_not_matched(
        self,
        real_transport: Union[httpx.AsyncHTTPTransport, httpx.HTTPTransport],
        request: httpx.Request,
    ) -> NoReturn:
        self._requests_not_matched.append(request)
>       raise httpx.TimeoutException(
            self._explain_that_no_response_was_found(real_transport, request),
            request=request,
        )
E       httpx.TimeoutException: No response can be found for PATCH request on http://example.org/upload with {'Patch-Content-Range': 'bytes 524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
E       - Match any request with {'Patch-Content-Range': 'bytes 2621440-3145727/4194304'} headers
E       - Already matched any request with {'Content-Length': '524288'} headers
E       
E       If you wanted to reuse an already matched response instead of registering it again, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-a-response-for-more-than-one-request

/usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191: TimeoutException

The above exception was the direct cause of the following exception:

tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_upload_chunked_timeout0')
httpx_mock = <pytest_httpx._httpx_mock.HTTPXMock object at 0x7fbc557677f0>

    @pytest.mark.asyncio
    async def test_upload_chunked_timeout(
            tmp_path: Path,
            httpx_mock: HTTPXMock,
    ):
        """Verify that protocol errors are handled properly.
    
        Check that timeouts and other protocol errors cause the failed chunk to be repeatedly
        re-uploaded, and, failing that, ultimately raise an appropriate exception allowing
        the issue to be reported.
        """
        httpx_mock.add_response(
            match_headers={
                "Content-Length": str(CHUNK_SIZE),
            },
        )
    
        break_at_chunk = 5
        break_at = "bytes %d-%d/%d" % (
            break_at_chunk * CHUNK_SIZE,
            (break_at_chunk + 1) * CHUNK_SIZE - 1,
            SIZE,
        )
    
        httpx_mock.add_exception(
            httpx.ReadTimeout("Simulated timeout"),
            match_headers={
                "Patch-Content-Range": break_at,
            },
        )
    
        tmp_file = tmp_path / "tempfile"
        with tmp_file.open("wb") as f:
            f.truncate(SIZE)
    
        async with httpx.AsyncClient() as client:
            file = await aiofiles.open(tmp_file, 'rb')
            with pytest.raises(
                    ChunkedUploadError,
                    match=f"Upload error at range {break_at} .attempt 4.: Simulated timeout",
            ) as excinfo:
>               await upload_chunked(
                    client,
                    "http://example.org/upload",
                    data=file,
                    size=SIZE,
                    chunk_size=CHUNK_SIZE,
                )

tests/chunked_uploads/test_upload_chunked.py:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

client = <httpx.AsyncClient object at 0x7fbc557654b0>
uri = 'http://example.org/upload'
data = <aiofiles.threadpool.binary.AsyncBufferedReader object at 0x7fbc55765900> wrapping <_io.BufferedReader name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_timeout0/tempfile'>
size = 4194304, chunk_size = 524288, headers = {}, kv = {}
content_range = <ContentRange 'bytes 524288-1048575/4194304'>, attempt = 4
file_hasher = <md5 _hashlib.HASH object @ 0x7fbc5586d4b0>
chunk_headers = {'Content-Length': '524288', 'Patch-Content-Range': 'bytes 524288-1048575/4194304'}
offset = 524288
chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
pos = 1048576

    async def upload_chunked(
            client: httpx.AsyncClient,
            uri: str,
            data: AsyncFileIO,
            size: int,
            chunk_size: int = UPLOAD_CHUNK_SIZE,
            headers=None,
            **kv,
    ):
        if not headers:
            headers = {}
    
        content_range = None
        attempt = 0
        file_hasher = hashlib.md5()
        try:
            chunk_headers = headers.copy()
            await data.seek(0)
            while True:
                offset = await data.tell()
                chunk = await data.read(chunk_size)
                if not chunk:
                    break
                pos = await data.tell()
    
                file_hasher.update(chunk)
    
                content_range = ContentRange(
                    start=offset,
                    stop=pos,
                    length=size,
                    units="bytes",
                )
                chunk_headers["Patch-Content-Range"] = content_range.to_header()
                chunk_headers["Content-Length"] = str(len(chunk))
                exc = None
                for attempt in range(MAX_ATTEMPTS):
                    try:
                        logger.debug("patching", uri=uri, size=len(chunk), content_range=content_range, attempt=attempt)
                        r = await client.patch(
                            uri,
                            content=chunk,
                            headers=chunk_headers,
                            **kv,
                        )
                        logger.debug("patch result", result=r)
                        if r.is_success:
                            break
                        else:
                            r.raise_for_status()
                    except httpx.HTTPStatusError as e:
                        if not e.response.is_server_error:
                            logger.debug("not server error, not retrying", resp=e.response)
                            raise
                        logger.exception("retrying", attempt=attempt)
                        exc = e
                    except httpx.HTTPError as e:
                        logger.exception("retrying", attempt=attempt)
                        exc = e
                else:
                    raise exc
    
            logger.debug("get etag", uri=uri)
            # now verify the hash
            r = await client.head(
                uri,
                headers=headers,
            )
            calculated_hash = file_hasher.hexdigest()
            etag, _ = unquote_etag(r.headers.get("etag"))
    
            logger.debug("check upload", etag=etag, calculated_hash=calculated_hash)
    
            if etag != calculated_hash:
                raise ChunkedUploadVerificationError(
                    expected=calculated_hash,
                    actual=etag,
                )
    
        except httpx.HTTPError as e:
>           raise ChunkedUploadError(
                content_range=content_range,
                attempt=attempt,
            ) from e
E           obs_proxy.chunked_uploads.client.ChunkedUploadError: Upload error at range bytes 524288-1048575/4194304 (attempt 4): No response can be found for PATCH request on http://example.org/upload with {'Patch-Content-Range': 'bytes 524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
E           - Match any request with {'Patch-Content-Range': 'bytes 2621440-3145727/4194304'} headers
E           - Already matched any request with {'Content-Length': '524288'} headers
E           
E           If you wanted to reuse an already matched response instead of registering it again, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-a-response-for-more-than-one-request

obs_proxy/chunked_uploads/client.py:125: ChunkedUploadError

During handling of the above exception, another exception occurred:

tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_upload_chunked_timeout0')
httpx_mock = <pytest_httpx._httpx_mock.HTTPXMock object at 0x7fbc557677f0>

    @pytest.mark.asyncio
    async def test_upload_chunked_timeout(
            tmp_path: Path,
            httpx_mock: HTTPXMock,
    ):
        """Verify that protocol errors are handled properly.
    
        Check that timeouts and other protocol errors cause the failed chunk to be repeatedly
        re-uploaded, and, failing that, ultimately raise an appropriate exception allowing
        the issue to be reported.
        """
        httpx_mock.add_response(
            match_headers={
                "Content-Length": str(CHUNK_SIZE),
            },
        )
    
        break_at_chunk = 5
        break_at = "bytes %d-%d/%d" % (
            break_at_chunk * CHUNK_SIZE,
            (break_at_chunk + 1) * CHUNK_SIZE - 1,
            SIZE,
        )
    
        httpx_mock.add_exception(
            httpx.ReadTimeout("Simulated timeout"),
            match_headers={
                "Patch-Content-Range": break_at,
            },
        )
    
        tmp_file = tmp_path / "tempfile"
        with tmp_file.open("wb") as f:
            f.truncate(SIZE)
    
        async with httpx.AsyncClient() as client:
            file = await aiofiles.open(tmp_file, 'rb')
>           with pytest.raises(
                    ChunkedUploadError,
                    match=f"Upload error at range {break_at} .attempt 4.: Simulated timeout",
            ) as excinfo:
E           AssertionError: Regex pattern did not match.
E            Regex: 'Upload error at range bytes 2621440-3145727/4194304 .attempt 4.: Simulated timeout'
E            Input: "Upload error at range bytes 524288-1048575/4194304 (attempt 4): No response can be found for PATCH request on http://example.org/upload with {'Patch-Content-Range': 'bytes 524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:\n- Match any request with {'Patch-Content-Range': 'bytes 2621440-3145727/4194304'} headers\n- Already matched any request with {'Content-Length': '524288'} headers\n\nIf you wanted to reuse an already matched response instead of registering it again, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-a-response-for-more-than-one-request"

tests/chunked_uploads/test_upload_chunked.py:56: AssertionError
----------------------------- Captured stdout call -----------------------------
2025-01-02 10:00:20 [debug    ] patching                       attempt=0 content_range=<ContentRange 'bytes 0-524287/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:20 [debug    ] patch result                   result=<Response [200 OK]>
2025-01-02 10:00:20 [debug    ] patching                       attempt=0 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:20 [error    ] retrying                       attempt=0
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 0                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc557654b0>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc55765900> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = None                                                     │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc5586d4b0>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55765bd0>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55765bd0>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc557559c0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc557654b0>        │          │
│ │     start = 130.68963083                                        │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc557677f0>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc557676d0>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557677f0>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557677f0>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:21 [debug    ] patching                       attempt=1 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:21 [error    ] retrying                       attempt=1
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 1                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc557654b0>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc55765900> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc5586d4b0>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55587dc0>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55587dc0>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc55603f40>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc557654b0>        │          │
│ │     start = 131.957492107                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc557677f0>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc557676d0>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557677f0>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557677f0>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:22 [debug    ] patching                       attempt=2 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:22 [error    ] retrying                       attempt=2
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 2                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc557654b0>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc55765900> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc5586d4b0>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55f8ecb0>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55f8ecb0>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc55603e40>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc557654b0>        │          │
│ │     start = 133.071486882                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc557677f0>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc557676d0>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557677f0>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557677f0>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:23 [debug    ] patching                       attempt=3 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:23 [error    ] retrying                       attempt=3
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 3                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc557654b0>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc55765900> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc5586d4b0>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc558f63e0>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc558f63e0>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc55603ec0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc557654b0>        │          │
│ │     start = 134.129792548                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc557677f0>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc557676d0>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557677f0>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557677f0>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:25 [debug    ] patching                       attempt=4 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:25 [error    ] retrying                       attempt=4
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 4                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc557654b0>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc55765900> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc5586d4b0>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55d9b7c0>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55d9b7c0>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc55603f40>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557654b0>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc557654b0>        │          │
│ │     start = 135.192214438                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc557677f0>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc557676d0>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557677f0>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc556e58d0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557677f0>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

______________________ test_upload_chunked_wrong_response ______________________

client = <httpx.AsyncClient object at 0x7fbc54ae1f90>
uri = 'http://example.org/upload'
data = <aiofiles.threadpool.binary.AsyncBufferedReader object at 0x7fbc54ae3af0> wrapping <_io.BufferedReader name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_wrong_resp0/tempfile'>
size = 4194304, chunk_size = 524288, headers = {}, kv = {}
content_range = <ContentRange 'bytes 524288-1048575/4194304'>, attempt = 4
file_hasher = <md5 _hashlib.HASH object @ 0x7fbc555f45d0>
chunk_headers = {'Content-Length': '524288', 'Patch-Content-Range': 'bytes 524288-1048575/4194304'}
offset = 524288
chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
pos = 1048576

    async def upload_chunked(
            client: httpx.AsyncClient,
            uri: str,
            data: AsyncFileIO,
            size: int,
            chunk_size: int = UPLOAD_CHUNK_SIZE,
            headers=None,
            **kv,
    ):
        if not headers:
            headers = {}
    
        content_range = None
        attempt = 0
        file_hasher = hashlib.md5()
        try:
            chunk_headers = headers.copy()
            await data.seek(0)
            while True:
                offset = await data.tell()
                chunk = await data.read(chunk_size)
                if not chunk:
                    break
                pos = await data.tell()
    
                file_hasher.update(chunk)
    
                content_range = ContentRange(
                    start=offset,
                    stop=pos,
                    length=size,
                    units="bytes",
                )
                chunk_headers["Patch-Content-Range"] = content_range.to_header()
                chunk_headers["Content-Length"] = str(len(chunk))
                exc = None
                for attempt in range(MAX_ATTEMPTS):
                    try:
                        logger.debug("patching", uri=uri, size=len(chunk), content_range=content_range, attempt=attempt)
                        r = await client.patch(
                            uri,
                            content=chunk,
                            headers=chunk_headers,
                            **kv,
                        )
                        logger.debug("patch result", result=r)
                        if r.is_success:
                            break
                        else:
                            r.raise_for_status()
                    except httpx.HTTPStatusError as e:
                        if not e.response.is_server_error:
                            logger.debug("not server error, not retrying", resp=e.response)
                            raise
                        logger.exception("retrying", attempt=attempt)
                        exc = e
                    except httpx.HTTPError as e:
                        logger.exception("retrying", attempt=attempt)
                        exc = e
                else:
>                   raise exc

obs_proxy/chunked_uploads/client.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
obs_proxy/chunked_uploads/client.py:84: in upload_chunked
    r = await client.patch(
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1933: in patch
    return await self.request(
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1540: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1629: in send
    response = await self._send_handling_auth(
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1657: in _send_handling_auth
    response = await self._send_handling_redirects(
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1694: in _send_handling_redirects
    response = await self._send_single_request(request)
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1730: in _send_single_request
    response = await transport.handle_async_request(request)
/usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56: in mocked_handle_async_request
    return await mock._handle_async_request(transport, request)
/usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183: in _handle_async_request
    self._request_not_matched(real_transport, request)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_httpx._httpx_mock.HTTPXMock object at 0x7fbc54ae0d30>
real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>
request = <Request('PATCH', 'http://example.org/upload')>

    def _request_not_matched(
        self,
        real_transport: Union[httpx.AsyncHTTPTransport, httpx.HTTPTransport],
        request: httpx.Request,
    ) -> NoReturn:
        self._requests_not_matched.append(request)
>       raise httpx.TimeoutException(
            self._explain_that_no_response_was_found(real_transport, request),
            request=request,
        )
E       httpx.TimeoutException: No response can be found for PATCH request on http://example.org/upload with {'Patch-Content-Range': 'bytes 524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
E       - Match any request with {'Patch-Content-Range': 'bytes 2621440-3145727/4194304'} headers
E       - Already matched any request with {'Content-Length': '524288'} headers
E       
E       If you wanted to reuse an already matched response instead of registering it again, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-a-response-for-more-than-one-request

/usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191: TimeoutException

The above exception was the direct cause of the following exception:

tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_upload_chunked_wrong_resp0')
httpx_mock = <pytest_httpx._httpx_mock.HTTPXMock object at 0x7fbc54ae0d30>

    @pytest.mark.asyncio
    async def test_upload_chunked_wrong_response(
            tmp_path: Path,
            httpx_mock: HTTPXMock,
    ):
        """Verify that unexpected HTTP responses interrupt the upload immediately and raise an exception"""
        httpx_mock.add_response(
            match_headers={
                "Content-Length": str(CHUNK_SIZE),
            },
        )
    
        break_at_chunk = 5
        break_at = "bytes %d-%d/%d" % (
            break_at_chunk * CHUNK_SIZE,
            (break_at_chunk + 1) * CHUNK_SIZE - 1,
            SIZE,
        )
    
        httpx_mock.add_response(
            status_code=418,
            match_headers={
                "Patch-Content-Range": break_at,
            },
        )
    
        tmp_file = tmp_path / "tempfile"
        with tmp_file.open("wb") as f:
            f.truncate(SIZE)
    
        async with httpx.AsyncClient() as client:
            file = await aiofiles.open(tmp_file, 'rb')
            with pytest.raises(
                    ChunkedUploadError,
                    match=f"Upload error at range {break_at} .attempt 0.: .*418 I'm a teapot.*",
            ) as excinfo:
>               await upload_chunked(
                    client,
                    "http://example.org/upload",
                    data=file,
                    size=SIZE,
                    chunk_size=CHUNK_SIZE,
                )

tests/chunked_uploads/test_upload_chunked.py:106: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

client = <httpx.AsyncClient object at 0x7fbc54ae1f90>
uri = 'http://example.org/upload'
data = <aiofiles.threadpool.binary.AsyncBufferedReader object at 0x7fbc54ae3af0> wrapping <_io.BufferedReader name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_wrong_resp0/tempfile'>
size = 4194304, chunk_size = 524288, headers = {}, kv = {}
content_range = <ContentRange 'bytes 524288-1048575/4194304'>, attempt = 4
file_hasher = <md5 _hashlib.HASH object @ 0x7fbc555f45d0>
chunk_headers = {'Content-Length': '524288', 'Patch-Content-Range': 'bytes 524288-1048575/4194304'}
offset = 524288
chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
pos = 1048576

    async def upload_chunked(
            client: httpx.AsyncClient,
            uri: str,
            data: AsyncFileIO,
            size: int,
            chunk_size: int = UPLOAD_CHUNK_SIZE,
            headers=None,
            **kv,
    ):
        if not headers:
            headers = {}
    
        content_range = None
        attempt = 0
        file_hasher = hashlib.md5()
        try:
            chunk_headers = headers.copy()
            await data.seek(0)
            while True:
                offset = await data.tell()
                chunk = await data.read(chunk_size)
                if not chunk:
                    break
                pos = await data.tell()
    
                file_hasher.update(chunk)
    
                content_range = ContentRange(
                    start=offset,
                    stop=pos,
                    length=size,
                    units="bytes",
                )
                chunk_headers["Patch-Content-Range"] = content_range.to_header()
                chunk_headers["Content-Length"] = str(len(chunk))
                exc = None
                for attempt in range(MAX_ATTEMPTS):
                    try:
                        logger.debug("patching", uri=uri, size=len(chunk), content_range=content_range, attempt=attempt)
                        r = await client.patch(
                            uri,
                            content=chunk,
                            headers=chunk_headers,
                            **kv,
                        )
                        logger.debug("patch result", result=r)
                        if r.is_success:
                            break
                        else:
                            r.raise_for_status()
                    except httpx.HTTPStatusError as e:
                        if not e.response.is_server_error:
                            logger.debug("not server error, not retrying", resp=e.response)
                            raise
                        logger.exception("retrying", attempt=attempt)
                        exc = e
                    except httpx.HTTPError as e:
                        logger.exception("retrying", attempt=attempt)
                        exc = e
                else:
                    raise exc
    
            logger.debug("get etag", uri=uri)
            # now verify the hash
            r = await client.head(
                uri,
                headers=headers,
            )
            calculated_hash = file_hasher.hexdigest()
            etag, _ = unquote_etag(r.headers.get("etag"))
    
            logger.debug("check upload", etag=etag, calculated_hash=calculated_hash)
    
            if etag != calculated_hash:
                raise ChunkedUploadVerificationError(
                    expected=calculated_hash,
                    actual=etag,
                )
    
        except httpx.HTTPError as e:
>           raise ChunkedUploadError(
                content_range=content_range,
                attempt=attempt,
            ) from e
E           obs_proxy.chunked_uploads.client.ChunkedUploadError: Upload error at range bytes 524288-1048575/4194304 (attempt 4): No response can be found for PATCH request on http://example.org/upload with {'Patch-Content-Range': 'bytes 524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
E           - Match any request with {'Patch-Content-Range': 'bytes 2621440-3145727/4194304'} headers
E           - Already matched any request with {'Content-Length': '524288'} headers
E           
E           If you wanted to reuse an already matched response instead of registering it again, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-a-response-for-more-than-one-request

obs_proxy/chunked_uploads/client.py:125: ChunkedUploadError

During handling of the above exception, another exception occurred:

tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_upload_chunked_wrong_resp0')
httpx_mock = <pytest_httpx._httpx_mock.HTTPXMock object at 0x7fbc54ae0d30>

    @pytest.mark.asyncio
    async def test_upload_chunked_wrong_response(
            tmp_path: Path,
            httpx_mock: HTTPXMock,
    ):
        """Verify that unexpected HTTP responses interrupt the upload immediately and raise an exception"""
        httpx_mock.add_response(
            match_headers={
                "Content-Length": str(CHUNK_SIZE),
            },
        )
    
        break_at_chunk = 5
        break_at = "bytes %d-%d/%d" % (
            break_at_chunk * CHUNK_SIZE,
            (break_at_chunk + 1) * CHUNK_SIZE - 1,
            SIZE,
        )
    
        httpx_mock.add_response(
            status_code=418,
            match_headers={
                "Patch-Content-Range": break_at,
            },
        )
    
        tmp_file = tmp_path / "tempfile"
        with tmp_file.open("wb") as f:
            f.truncate(SIZE)
    
        async with httpx.AsyncClient() as client:
            file = await aiofiles.open(tmp_file, 'rb')
>           with pytest.raises(
                    ChunkedUploadError,
                    match=f"Upload error at range {break_at} .attempt 0.: .*418 I'm a teapot.*",
            ) as excinfo:
E           AssertionError: Regex pattern did not match.
E            Regex: "Upload error at range bytes 2621440-3145727/4194304 .attempt 0.: .*418 I'm a teapot.*"
E            Input: "Upload error at range bytes 524288-1048575/4194304 (attempt 4): No response can be found for PATCH request on http://example.org/upload with {'Patch-Content-Range': 'bytes 524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:\n- Match any request with {'Patch-Content-Range': 'bytes 2621440-3145727/4194304'} headers\n- Already matched any request with {'Content-Length': '524288'} headers\n\nIf you wanted to reuse an already matched response instead of registering it again, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-a-response-for-more-than-one-request"

tests/chunked_uploads/test_upload_chunked.py:102: AssertionError
----------------------------- Captured stdout call -----------------------------
2025-01-02 10:00:26 [debug    ] patching                       attempt=0 content_range=<ContentRange 'bytes 0-524287/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:26 [debug    ] patch result                   result=<Response [200 OK]>
2025-01-02 10:00:26 [debug    ] patching                       attempt=0 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:26 [error    ] retrying                       attempt=0
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 0                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc54ae1f90>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc54ae3af0> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = None                                                     │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc555f45d0>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc54ae3820>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc54ae3820>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc54b2c6c0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc54ae1f90>        │          │
│ │     start = 136.453167555                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc54ae0d30>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc54ae0dc0>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54ae0d30>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54ae0d30>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:27 [debug    ] patching                       attempt=1 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:27 [error    ] retrying                       attempt=1
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 1                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc54ae1f90>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc54ae3af0> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc555f45d0>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc557b82b0>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc557b82b0>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc55603f40>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc54ae1f90>        │          │
│ │     start = 137.586904491                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc54ae0d30>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc54ae0dc0>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54ae0d30>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54ae0d30>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:28 [debug    ] patching                       attempt=2 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:28 [error    ] retrying                       attempt=2
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 2                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc54ae1f90>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc54ae3af0> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc555f45d0>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc5579fe80>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc5579fe80>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc55755640>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc54ae1f90>        │          │
│ │     start = 138.493519239                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc54ae0d30>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc54ae0dc0>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54ae0d30>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54ae0d30>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:29 [debug    ] patching                       attempt=3 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:29 [error    ] retrying                       attempt=3
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 3                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc54ae1f90>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc54ae3af0> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc555f45d0>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55966140>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55966140>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc557558c0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc54ae1f90>        │          │
│ │     start = 139.388829387                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc54ae0d30>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc54ae0dc0>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54ae0d30>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54ae0d30>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:30 [debug    ] patching                       attempt=4 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:30 [error    ] retrying                       attempt=4
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 4                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc54ae1f90>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc54ae3af0> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc555f45d0>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55966f80>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55966f80>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc557557c0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54ae1f90>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc54ae1f90>        │          │
│ │     start = 140.349997272                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc54ae0d30>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc54ae0dc0>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54ae0d30>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54ae3ee0>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54ae0d30>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

__________________ test_upload_chunked_transient_server_error __________________

client = <httpx.AsyncClient object at 0x7fbc557a1f30>
uri = 'http://example.org/upload'
data = <aiofiles.threadpool.binary.AsyncBufferedReader object at 0x7fbc557a0e20> wrapping <_io.BufferedReader name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_transient_0/tempfile'>
size = 4194304, chunk_size = 524288, headers = {}, kv = {}
content_range = <ContentRange 'bytes 524288-1048575/4194304'>, attempt = 4
file_hasher = <md5 _hashlib.HASH object @ 0x7fbc54baf330>
chunk_headers = {'Content-Length': '524288', 'Patch-Content-Range': 'bytes 524288-1048575/4194304'}
offset = 524288
chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
pos = 1048576

    async def upload_chunked(
            client: httpx.AsyncClient,
            uri: str,
            data: AsyncFileIO,
            size: int,
            chunk_size: int = UPLOAD_CHUNK_SIZE,
            headers=None,
            **kv,
    ):
        if not headers:
            headers = {}
    
        content_range = None
        attempt = 0
        file_hasher = hashlib.md5()
        try:
            chunk_headers = headers.copy()
            await data.seek(0)
            while True:
                offset = await data.tell()
                chunk = await data.read(chunk_size)
                if not chunk:
                    break
                pos = await data.tell()
    
                file_hasher.update(chunk)
    
                content_range = ContentRange(
                    start=offset,
                    stop=pos,
                    length=size,
                    units="bytes",
                )
                chunk_headers["Patch-Content-Range"] = content_range.to_header()
                chunk_headers["Content-Length"] = str(len(chunk))
                exc = None
                for attempt in range(MAX_ATTEMPTS):
                    try:
                        logger.debug("patching", uri=uri, size=len(chunk), content_range=content_range, attempt=attempt)
                        r = await client.patch(
                            uri,
                            content=chunk,
                            headers=chunk_headers,
                            **kv,
                        )
                        logger.debug("patch result", result=r)
                        if r.is_success:
                            break
                        else:
                            r.raise_for_status()
                    except httpx.HTTPStatusError as e:
                        if not e.response.is_server_error:
                            logger.debug("not server error, not retrying", resp=e.response)
                            raise
                        logger.exception("retrying", attempt=attempt)
                        exc = e
                    except httpx.HTTPError as e:
                        logger.exception("retrying", attempt=attempt)
                        exc = e
                else:
>                   raise exc

obs_proxy/chunked_uploads/client.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
obs_proxy/chunked_uploads/client.py:84: in upload_chunked
    r = await client.patch(
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1933: in patch
    return await self.request(
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1540: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1629: in send
    response = await self._send_handling_auth(
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1657: in _send_handling_auth
    response = await self._send_handling_redirects(
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1694: in _send_handling_redirects
    response = await self._send_single_request(request)
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1730: in _send_single_request
    response = await transport.handle_async_request(request)
/usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56: in mocked_handle_async_request
    return await mock._handle_async_request(transport, request)
/usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183: in _handle_async_request
    self._request_not_matched(real_transport, request)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_httpx._httpx_mock.HTTPXMock object at 0x7fbc557a3b80>
real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>
request = <Request('PATCH', 'http://example.org/upload')>

    def _request_not_matched(
        self,
        real_transport: Union[httpx.AsyncHTTPTransport, httpx.HTTPTransport],
        request: httpx.Request,
    ) -> NoReturn:
        self._requests_not_matched.append(request)
>       raise httpx.TimeoutException(
            self._explain_that_no_response_was_found(real_transport, request),
            request=request,
        )
E       httpx.TimeoutException: No response can be found for PATCH request on http://example.org/upload with {'Patch-Content-Range': 'bytes 524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
E       - Match any request with {'Patch-Content-Range': 'bytes 2621440-3145727/4194304'} headers
E       - Already matched any request with {'Content-Length': '524288'} headers
E       
E       If you wanted to reuse an already matched response instead of registering it again, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-a-response-for-more-than-one-request

/usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191: TimeoutException

The above exception was the direct cause of the following exception:

tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_upload_chunked_transient_0')
httpx_mock = <pytest_httpx._httpx_mock.HTTPXMock object at 0x7fbc557a3b80>

    @pytest.mark.asyncio
    async def test_upload_chunked_transient_server_error(
            tmp_path: Path,
            httpx_mock: HTTPXMock,
    ):
        """Verify that unexpected HTTP responses in 5xx range cause a retry and raise an exception if persist"""
        httpx_mock.add_response(
            match_headers={
                "Content-Length": str(CHUNK_SIZE),
            },
        )
    
        break_at_chunk = 5
        break_at = "bytes %d-%d/%d" % (
            break_at_chunk * CHUNK_SIZE,
            (break_at_chunk + 1) * CHUNK_SIZE - 1,
            SIZE,
        )
    
        failed_once = False
    
        def fail_once(request: httpx.Request):
            if not failed_once:
                return httpx.Response(
                    status_code=500,
                )
            else:
                return httpx.Response(
                    status_code=200,
                )
    
        httpx_mock.add_callback(
            fail_once,
            match_headers={
                "Patch-Content-Range": break_at,
            },
        )
    
        tmp_file = tmp_path / "tempfile"
        with tmp_file.open("wb") as f:
            f.truncate(SIZE)
    
        async with httpx.AsyncClient() as client:
            file = await aiofiles.open(tmp_file, 'rb')
            with pytest.raises(
                    ChunkedUploadError,
                    match=f"Upload error at range {break_at} .attempt 4.: .*500 Internal Server Error.*",
            ) as excinfo:
>               await upload_chunked(
                    client,
                    "http://example.org/upload",
                    data=file,
                    size=SIZE,
                    chunk_size=CHUNK_SIZE,
                )

tests/chunked_uploads/test_upload_chunked.py:165: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

client = <httpx.AsyncClient object at 0x7fbc557a1f30>
uri = 'http://example.org/upload'
data = <aiofiles.threadpool.binary.AsyncBufferedReader object at 0x7fbc557a0e20> wrapping <_io.BufferedReader name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_transient_0/tempfile'>
size = 4194304, chunk_size = 524288, headers = {}, kv = {}
content_range = <ContentRange 'bytes 524288-1048575/4194304'>, attempt = 4
file_hasher = <md5 _hashlib.HASH object @ 0x7fbc54baf330>
chunk_headers = {'Content-Length': '524288', 'Patch-Content-Range': 'bytes 524288-1048575/4194304'}
offset = 524288
chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
pos = 1048576

    async def upload_chunked(
            client: httpx.AsyncClient,
            uri: str,
            data: AsyncFileIO,
            size: int,
            chunk_size: int = UPLOAD_CHUNK_SIZE,
            headers=None,
            **kv,
    ):
        if not headers:
            headers = {}
    
        content_range = None
        attempt = 0
        file_hasher = hashlib.md5()
        try:
            chunk_headers = headers.copy()
            await data.seek(0)
            while True:
                offset = await data.tell()
                chunk = await data.read(chunk_size)
                if not chunk:
                    break
                pos = await data.tell()
    
                file_hasher.update(chunk)
    
                content_range = ContentRange(
                    start=offset,
                    stop=pos,
                    length=size,
                    units="bytes",
                )
                chunk_headers["Patch-Content-Range"] = content_range.to_header()
                chunk_headers["Content-Length"] = str(len(chunk))
                exc = None
                for attempt in range(MAX_ATTEMPTS):
                    try:
                        logger.debug("patching", uri=uri, size=len(chunk), content_range=content_range, attempt=attempt)
                        r = await client.patch(
                            uri,
                            content=chunk,
                            headers=chunk_headers,
                            **kv,
                        )
                        logger.debug("patch result", result=r)
                        if r.is_success:
                            break
                        else:
                            r.raise_for_status()
                    except httpx.HTTPStatusError as e:
                        if not e.response.is_server_error:
                            logger.debug("not server error, not retrying", resp=e.response)
                            raise
                        logger.exception("retrying", attempt=attempt)
                        exc = e
                    except httpx.HTTPError as e:
                        logger.exception("retrying", attempt=attempt)
                        exc = e
                else:
                    raise exc
    
            logger.debug("get etag", uri=uri)
            # now verify the hash
            r = await client.head(
                uri,
                headers=headers,
            )
            calculated_hash = file_hasher.hexdigest()
            etag, _ = unquote_etag(r.headers.get("etag"))
    
            logger.debug("check upload", etag=etag, calculated_hash=calculated_hash)
    
            if etag != calculated_hash:
                raise ChunkedUploadVerificationError(
                    expected=calculated_hash,
                    actual=etag,
                )
    
        except httpx.HTTPError as e:
>           raise ChunkedUploadError(
                content_range=content_range,
                attempt=attempt,
            ) from e
E           obs_proxy.chunked_uploads.client.ChunkedUploadError: Upload error at range bytes 524288-1048575/4194304 (attempt 4): No response can be found for PATCH request on http://example.org/upload with {'Patch-Content-Range': 'bytes 524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
E           - Match any request with {'Patch-Content-Range': 'bytes 2621440-3145727/4194304'} headers
E           - Already matched any request with {'Content-Length': '524288'} headers
E           
E           If you wanted to reuse an already matched response instead of registering it again, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-a-response-for-more-than-one-request

obs_proxy/chunked_uploads/client.py:125: ChunkedUploadError

During handling of the above exception, another exception occurred:

tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_upload_chunked_transient_0')
httpx_mock = <pytest_httpx._httpx_mock.HTTPXMock object at 0x7fbc557a3b80>

    @pytest.mark.asyncio
    async def test_upload_chunked_transient_server_error(
            tmp_path: Path,
            httpx_mock: HTTPXMock,
    ):
        """Verify that unexpected HTTP responses in 5xx range cause a retry and raise an exception if persist"""
        httpx_mock.add_response(
            match_headers={
                "Content-Length": str(CHUNK_SIZE),
            },
        )
    
        break_at_chunk = 5
        break_at = "bytes %d-%d/%d" % (
            break_at_chunk * CHUNK_SIZE,
            (break_at_chunk + 1) * CHUNK_SIZE - 1,
            SIZE,
        )
    
        failed_once = False
    
        def fail_once(request: httpx.Request):
            if not failed_once:
                return httpx.Response(
                    status_code=500,
                )
            else:
                return httpx.Response(
                    status_code=200,
                )
    
        httpx_mock.add_callback(
            fail_once,
            match_headers={
                "Patch-Content-Range": break_at,
            },
        )
    
        tmp_file = tmp_path / "tempfile"
        with tmp_file.open("wb") as f:
            f.truncate(SIZE)
    
        async with httpx.AsyncClient() as client:
            file = await aiofiles.open(tmp_file, 'rb')
>           with pytest.raises(
                    ChunkedUploadError,
                    match=f"Upload error at range {break_at} .attempt 4.: .*500 Internal Server Error.*",
            ) as excinfo:
E           AssertionError: Regex pattern did not match.
E            Regex: 'Upload error at range bytes 2621440-3145727/4194304 .attempt 4.: .*500 Internal Server Error.*'
E            Input: "Upload error at range bytes 524288-1048575/4194304 (attempt 4): No response can be found for PATCH request on http://example.org/upload with {'Patch-Content-Range': 'bytes 524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:\n- Match any request with {'Patch-Content-Range': 'bytes 2621440-3145727/4194304'} headers\n- Already matched any request with {'Content-Length': '524288'} headers\n\nIf you wanted to reuse an already matched response instead of registering it again, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-a-response-for-more-than-one-request"

tests/chunked_uploads/test_upload_chunked.py:161: AssertionError
----------------------------- Captured stdout call -----------------------------
2025-01-02 10:00:31 [debug    ] patching                       attempt=0 content_range=<ContentRange 'bytes 0-524287/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:31 [debug    ] patch result                   result=<Response [200 OK]>
2025-01-02 10:00:31 [debug    ] patching                       attempt=0 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:31 [error    ] retrying                       attempt=0
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 0                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc557a1f30>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc557a0e20> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = None                                                     │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc54baf330>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc557a14e0>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc557a14e0>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc54b2edc0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc557a1f30>        │          │
│ │     start = 141.568768411                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc557a3b80>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc557a0160>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557a3b80>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557a3b80>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:32 [debug    ] patching                       attempt=1 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:32 [error    ] retrying                       attempt=1
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 1                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc557a1f30>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc557a0e20> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc54baf330>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55df8b20>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55df8b20>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc547977c0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc557a1f30>        │          │
│ │     start = 142.614268669                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc557a3b80>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc557a0160>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557a3b80>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557a3b80>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:33 [debug    ] patching                       attempt=2 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:33 [error    ] retrying                       attempt=2
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 2                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc557a1f30>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc557a0e20> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc54baf330>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc557b8670>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc557b8670>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc55755640>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc557a1f30>        │          │
│ │     start = 143.712498183                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc557a3b80>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc557a0160>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557a3b80>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557a3b80>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:34 [debug    ] patching                       attempt=3 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:34 [error    ] retrying                       attempt=3
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 3                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc557a1f30>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc557a0e20> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc54baf330>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55d9b3d0>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55d9b3d0>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc557557c0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc557a1f30>        │          │
│ │     start = 144.969778418                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc557a3b80>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc557a0160>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557a3b80>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557a3b80>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:35 [debug    ] patching                       attempt=4 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:35 [error    ] retrying                       attempt=4
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 4                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc557a1f30>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc557a0e20> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Patch-Content-Range': 'bytes 524288-1048575/4194304',  │ │
│ │                 'Content-Length': '524288'} headers amongst:\n- Match    │ │
│ │                 any request with {'Patch-Content-Range': 'bytes          │ │
│ │                 2621440-3145727/4194304'} headers\n- Already matched any │ │
│ │                 request with {'Content-Length': '524288'} headers\n\nIf  │ │
│ │                 you wanted to reuse an already matched response instead  │ │
│ │                 of registering it again, refer to                        │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc54baf330>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc557a14e0>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc557a14e0>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc557554c0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc557a1f30>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc557a1f30>        │          │
│ │     start = 146.075017585                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc557a3b80>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc557a0160>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557a3b80>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc557a2440>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc557a3b80>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Patch-Content-Range': 'bytes 
524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:
- Match any request with {'Patch-Content-Range': 'bytes 
2621440-3145727/4194304'} headers
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

_________________________ test_upload_chunked_complete _________________________

client = <httpx.AsyncClient object at 0x7fbc54b45570>
uri = 'http://example.org/upload'
data = <aiofiles.threadpool.binary.AsyncBufferedReader object at 0x7fbc54b45450> wrapping <_io.BufferedReader name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_complete0/tempfile'>
size = 4194304, chunk_size = 524288, headers = {}, kv = {}
content_range = <ContentRange 'bytes 524288-1048575/4194304'>, attempt = 4
file_hasher = <md5 _hashlib.HASH object @ 0x7fbc547a5c50>
chunk_headers = {'Content-Length': '524288', 'Patch-Content-Range': 'bytes 524288-1048575/4194304'}
offset = 524288
chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
pos = 1048576

    async def upload_chunked(
            client: httpx.AsyncClient,
            uri: str,
            data: AsyncFileIO,
            size: int,
            chunk_size: int = UPLOAD_CHUNK_SIZE,
            headers=None,
            **kv,
    ):
        if not headers:
            headers = {}
    
        content_range = None
        attempt = 0
        file_hasher = hashlib.md5()
        try:
            chunk_headers = headers.copy()
            await data.seek(0)
            while True:
                offset = await data.tell()
                chunk = await data.read(chunk_size)
                if not chunk:
                    break
                pos = await data.tell()
    
                file_hasher.update(chunk)
    
                content_range = ContentRange(
                    start=offset,
                    stop=pos,
                    length=size,
                    units="bytes",
                )
                chunk_headers["Patch-Content-Range"] = content_range.to_header()
                chunk_headers["Content-Length"] = str(len(chunk))
                exc = None
                for attempt in range(MAX_ATTEMPTS):
                    try:
                        logger.debug("patching", uri=uri, size=len(chunk), content_range=content_range, attempt=attempt)
                        r = await client.patch(
                            uri,
                            content=chunk,
                            headers=chunk_headers,
                            **kv,
                        )
                        logger.debug("patch result", result=r)
                        if r.is_success:
                            break
                        else:
                            r.raise_for_status()
                    except httpx.HTTPStatusError as e:
                        if not e.response.is_server_error:
                            logger.debug("not server error, not retrying", resp=e.response)
                            raise
                        logger.exception("retrying", attempt=attempt)
                        exc = e
                    except httpx.HTTPError as e:
                        logger.exception("retrying", attempt=attempt)
                        exc = e
                else:
>                   raise exc

obs_proxy/chunked_uploads/client.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
obs_proxy/chunked_uploads/client.py:84: in upload_chunked
    r = await client.patch(
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1933: in patch
    return await self.request(
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1540: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1629: in send
    response = await self._send_handling_auth(
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1657: in _send_handling_auth
    response = await self._send_handling_redirects(
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1694: in _send_handling_redirects
    response = await self._send_single_request(request)
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1730: in _send_single_request
    response = await transport.handle_async_request(request)
/usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56: in mocked_handle_async_request
    return await mock._handle_async_request(transport, request)
/usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183: in _handle_async_request
    self._request_not_matched(real_transport, request)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_httpx._httpx_mock.HTTPXMock object at 0x7fbc54b46140>
real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>
request = <Request('PATCH', 'http://example.org/upload')>

    def _request_not_matched(
        self,
        real_transport: Union[httpx.AsyncHTTPTransport, httpx.HTTPTransport],
        request: httpx.Request,
    ) -> NoReturn:
        self._requests_not_matched.append(request)
>       raise httpx.TimeoutException(
            self._explain_that_no_response_was_found(real_transport, request),
            request=request,
        )
E       httpx.TimeoutException: No response can be found for PATCH request on http://example.org/upload with {'Content-Length': '524288'} headers amongst:
E       - Match HEAD request
E       - Already matched any request with {'Content-Length': '524288'} headers
E       
E       If you wanted to reuse an already matched response instead of registering it again, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-a-response-for-more-than-one-request

/usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191: TimeoutException

The above exception was the direct cause of the following exception:

tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_upload_chunked_complete0')
httpx_mock = <pytest_httpx._httpx_mock.HTTPXMock object at 0x7fbc54b46140>

    @pytest.mark.asyncio
    async def test_upload_chunked_complete(
            tmp_path: Path,
            httpx_mock: HTTPXMock,
    ):
        """Verify the complete upload is followed by a hashsum verification"""
        httpx_mock.add_response(
            match_headers={
                "Content-Length": str(CHUNK_SIZE),
            },
        )
    
        # this is the MD5 of 4 MB zeroes
        expected_md5 = "b5cfa9d6c8febd618f91ac2843d50a1c"
    
        httpx_mock.add_response(
            method="HEAD",
            headers={
                "ETag": quote_etag(expected_md5 + "foo"),
            },
        )
    
        tmp_file = tmp_path / "tempfile"
        with tmp_file.open("wb") as f:
            f.truncate(SIZE)
    
        async with httpx.AsyncClient() as client:
            file = await aiofiles.open(tmp_file, 'rb')
            with pytest.raises(
                    ChunkedUploadVerificationError,
            ) as excinfo:
>               await upload_chunked(
                    client,
                    "http://example.org/upload",
                    data=file,
                    size=SIZE,
                    chunk_size=CHUNK_SIZE,
                )

tests/chunked_uploads/test_upload_chunked.py:207: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

client = <httpx.AsyncClient object at 0x7fbc54b45570>
uri = 'http://example.org/upload'
data = <aiofiles.threadpool.binary.AsyncBufferedReader object at 0x7fbc54b45450> wrapping <_io.BufferedReader name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_complete0/tempfile'>
size = 4194304, chunk_size = 524288, headers = {}, kv = {}
content_range = <ContentRange 'bytes 524288-1048575/4194304'>, attempt = 4
file_hasher = <md5 _hashlib.HASH object @ 0x7fbc547a5c50>
chunk_headers = {'Content-Length': '524288', 'Patch-Content-Range': 'bytes 524288-1048575/4194304'}
offset = 524288
chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
pos = 1048576

    async def upload_chunked(
            client: httpx.AsyncClient,
            uri: str,
            data: AsyncFileIO,
            size: int,
            chunk_size: int = UPLOAD_CHUNK_SIZE,
            headers=None,
            **kv,
    ):
        if not headers:
            headers = {}
    
        content_range = None
        attempt = 0
        file_hasher = hashlib.md5()
        try:
            chunk_headers = headers.copy()
            await data.seek(0)
            while True:
                offset = await data.tell()
                chunk = await data.read(chunk_size)
                if not chunk:
                    break
                pos = await data.tell()
    
                file_hasher.update(chunk)
    
                content_range = ContentRange(
                    start=offset,
                    stop=pos,
                    length=size,
                    units="bytes",
                )
                chunk_headers["Patch-Content-Range"] = content_range.to_header()
                chunk_headers["Content-Length"] = str(len(chunk))
                exc = None
                for attempt in range(MAX_ATTEMPTS):
                    try:
                        logger.debug("patching", uri=uri, size=len(chunk), content_range=content_range, attempt=attempt)
                        r = await client.patch(
                            uri,
                            content=chunk,
                            headers=chunk_headers,
                            **kv,
                        )
                        logger.debug("patch result", result=r)
                        if r.is_success:
                            break
                        else:
                            r.raise_for_status()
                    except httpx.HTTPStatusError as e:
                        if not e.response.is_server_error:
                            logger.debug("not server error, not retrying", resp=e.response)
                            raise
                        logger.exception("retrying", attempt=attempt)
                        exc = e
                    except httpx.HTTPError as e:
                        logger.exception("retrying", attempt=attempt)
                        exc = e
                else:
                    raise exc
    
            logger.debug("get etag", uri=uri)
            # now verify the hash
            r = await client.head(
                uri,
                headers=headers,
            )
            calculated_hash = file_hasher.hexdigest()
            etag, _ = unquote_etag(r.headers.get("etag"))
    
            logger.debug("check upload", etag=etag, calculated_hash=calculated_hash)
    
            if etag != calculated_hash:
                raise ChunkedUploadVerificationError(
                    expected=calculated_hash,
                    actual=etag,
                )
    
        except httpx.HTTPError as e:
>           raise ChunkedUploadError(
                content_range=content_range,
                attempt=attempt,
            ) from e
E           obs_proxy.chunked_uploads.client.ChunkedUploadError: Upload error at range bytes 524288-1048575/4194304 (attempt 4): No response can be found for PATCH request on http://example.org/upload with {'Content-Length': '524288'} headers amongst:
E           - Match HEAD request
E           - Already matched any request with {'Content-Length': '524288'} headers
E           
E           If you wanted to reuse an already matched response instead of registering it again, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-a-response-for-more-than-one-request

obs_proxy/chunked_uploads/client.py:125: ChunkedUploadError
----------------------------- Captured stdout call -----------------------------
2025-01-02 10:00:37 [debug    ] patching                       attempt=0 content_range=<ContentRange 'bytes 0-524287/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:37 [debug    ] patch result                   result=<Response [200 OK]>
2025-01-02 10:00:37 [debug    ] patching                       attempt=0 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:37 [error    ] retrying                       attempt=0
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 0                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc54b45570>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc54b45450> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Content-Length': '524288'} headers amongst:\n- Match   │ │
│ │                 HEAD request\n- Already matched any request with         │ │
│ │                 {'Content-Length': '524288'} headers\n\nIf you wanted to │ │
│ │                 reuse an already matched response instead of registering │ │
│ │                 it again, refer to                                       │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = None                                                     │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc547a5c50>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc54b44700>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc54b44700>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc54b2f140>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc54b45570>        │          │
│ │     start = 147.451462275                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc54b46140>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc54b44850>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54b46140>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54b46140>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Content-Length': '524288'} headers amongst:
- Match HEAD request
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:38 [debug    ] patching                       attempt=1 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:38 [error    ] retrying                       attempt=1
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 1                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc54b45570>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc54b45450> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Content-Length': '524288'} headers amongst:\n- Match   │ │
│ │                 HEAD request\n- Already matched any request with         │ │
│ │                 {'Content-Length': '524288'} headers\n\nIf you wanted to │ │
│ │                 reuse an already matched response instead of registering │ │
│ │                 it again, refer to                                       │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Content-Length': '524288'} headers amongst:\n- Match   │ │
│ │                 HEAD request\n- Already matched any request with         │ │
│ │                 {'Content-Length': '524288'} headers\n\nIf you wanted to │ │
│ │                 reuse an already matched response instead of registering │ │
│ │                 it again, refer to                                       │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc547a5c50>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55df8b20>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55df8b20>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc547958c0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc54b45570>        │          │
│ │     start = 148.678581962                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc54b46140>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc54b44850>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54b46140>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54b46140>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Content-Length': '524288'} headers amongst:
- Match HEAD request
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:39 [debug    ] patching                       attempt=2 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:39 [error    ] retrying                       attempt=2
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 2                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc54b45570>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc54b45450> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Content-Length': '524288'} headers amongst:\n- Match   │ │
│ │                 HEAD request\n- Already matched any request with         │ │
│ │                 {'Content-Length': '524288'} headers\n\nIf you wanted to │ │
│ │                 reuse an already matched response instead of registering │ │
│ │                 it again, refer to                                       │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Content-Length': '524288'} headers amongst:\n- Match   │ │
│ │                 HEAD request\n- Already matched any request with         │ │
│ │                 {'Content-Length': '524288'} headers\n\nIf you wanted to │ │
│ │                 reuse an already matched response instead of registering │ │
│ │                 it again, refer to                                       │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc547a5c50>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55d9b7c0>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55d9b7c0>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc557554c0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc54b45570>        │          │
│ │     start = 150.075674832                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc54b46140>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc54b44850>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54b46140>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54b46140>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Content-Length': '524288'} headers amongst:
- Match HEAD request
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:41 [debug    ] patching                       attempt=3 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:41 [error    ] retrying                       attempt=3
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 3                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc54b45570>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc54b45450> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Content-Length': '524288'} headers amongst:\n- Match   │ │
│ │                 HEAD request\n- Already matched any request with         │ │
│ │                 {'Content-Length': '524288'} headers\n\nIf you wanted to │ │
│ │                 reuse an already matched response instead of registering │ │
│ │                 it again, refer to                                       │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Content-Length': '524288'} headers amongst:\n- Match   │ │
│ │                 HEAD request\n- Already matched any request with         │ │
│ │                 {'Content-Length': '524288'} headers\n\nIf you wanted to │ │
│ │                 reuse an already matched response instead of registering │ │
│ │                 it again, refer to                                       │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc547a5c50>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc5579fe80>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc5579fe80>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc55755640>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc54b45570>        │          │
│ │     start = 151.185487242                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc54b46140>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc54b44850>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54b46140>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54b46140>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Content-Length': '524288'} headers amongst:
- Match HEAD request
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

2025-01-02 10:00:41 [debug    ] patching                       attempt=4 content_range=<ContentRange 'bytes 524288-1048575/4194304'> size=524288 uri=http://example.org/upload
2025-01-02 10:00:41 [error    ] retrying                       attempt=4
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /builds/infrastructure/obs-proxy/obs_proxy/chunked_uploads/client.py:84 in   │
│ upload_chunked                                                               │
│                                                                              │
│    81 │   │   │   for attempt in range(MAX_ATTEMPTS):                        │
│    82 │   │   │   │   try:                                                   │
│    83 │   │   │   │   │   logger.debug("patching", uri=uri, size=len(chunk), │
│ ❱  84 │   │   │   │   │   r = await client.patch(                            │
│    85 │   │   │   │   │   │   uri,                                           │
│    86 │   │   │   │   │   │   content=chunk,                                 │
│    87 │   │   │   │   │   │   headers=chunk_headers,                         │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       attempt = 4                                                        │ │
│ │         chunk = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\… │ │
│ │ chunk_headers = {                                                        │ │
│ │                 │   'Patch-Content-Range': 'bytes                        │ │
│ │                 524288-1048575/4194304',                                 │ │
│ │                 │   'Content-Length': '524288'                           │ │
│ │                 }                                                        │ │
│ │    chunk_size = 524288                                                   │ │
│ │        client = <httpx.AsyncClient object at 0x7fbc54b45570>             │ │
│ │ content_range = <ContentRange 'bytes 524288-1048575/4194304'>            │ │
│ │          data = <aiofiles.threadpool.binary.AsyncBufferedReader object   │ │
│ │                 at 0x7fbc54b45450> wrapping <_io.BufferedReader          │ │
│ │                 name='/tmp/pytest-of-root/pytest-0/test_upload_chunked_… │ │
│ │             e = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Content-Length': '524288'} headers amongst:\n- Match   │ │
│ │                 HEAD request\n- Already matched any request with         │ │
│ │                 {'Content-Length': '524288'} headers\n\nIf you wanted to │ │
│ │                 reuse an already matched response instead of registering │ │
│ │                 it again, refer to                                       │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │           exc = TimeoutException("No response can be found for PATCH     │ │
│ │                 request on http://example.org/upload with                │ │
│ │                 {'Content-Length': '524288'} headers amongst:\n- Match   │ │
│ │                 HEAD request\n- Already matched any request with         │ │
│ │                 {'Content-Length': '524288'} headers\n\nIf you wanted to │ │
│ │                 reuse an already matched response instead of registering │ │
│ │                 it again, refer to                                       │ │
│ │                 https://github.com/Colin-b/pytest_httpx/blob/master/REA… │ │
│ │   file_hasher = <md5 _hashlib.HASH object @ 0x7fbc547a5c50>              │ │
│ │       headers = {}                                                       │ │
│ │            kv = {}                                                       │ │
│ │        offset = 524288                                                   │ │
│ │           pos = 1048576                                                  │ │
│ │             r = <Response [200 OK]>                                      │ │
│ │          size = 4194304                                                  │ │
│ │           uri = 'http://example.org/upload'                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1933 in patch       │
│                                                                              │
│   1930 │   │                                                                 │
│   1931 │   │   **Parameters**: See `httpx.request`.                          │
│   1932 │   │   """                                                           │
│ ❱ 1933 │   │   return await self.request(                                    │
│   1934 │   │   │   "PATCH",                                                  │
│   1935 │   │   │   url,                                                      │
│   1936 │   │   │   content=content,                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           params = None                                                  │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1540 in request     │
│                                                                              │
│   1537 │   │   │   timeout=timeout,                                          │
│   1538 │   │   │   extensions=extensions,                                    │
│   1539 │   │   )                                                             │
│ ❱ 1540 │   │   return await self.send(request, auth=auth, follow_redirects=f │
│   1541 │                                                                     │
│   1542 │   @asynccontextmanager                                              │
│   1543 │   async def stream(                                                 │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          content = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x… │ │
│ │          cookies = None                                                  │ │
│ │             data = None                                                  │ │
│ │       extensions = None                                                  │ │
│ │            files = None                                                  │ │
│ │ follow_redirects = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │          headers = {                                                     │ │
│ │                    │   'Patch-Content-Range': 'bytes                     │ │
│ │                    524288-1048575/4194304',                              │ │
│ │                    │   'Content-Length': '524288'                        │ │
│ │                    }                                                     │ │
│ │             json = None                                                  │ │
│ │           method = 'PATCH'                                               │ │
│ │           params = None                                                  │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ │          timeout = <httpx._client.UseClientDefault object at             │ │
│ │                    0x7fbc5724bb80>                                       │ │
│ │              url = 'http://example.org/upload'                           │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1629 in send        │
│                                                                              │
│   1626 │   │                                                                 │
│   1627 │   │   auth = self._build_request_auth(request, auth)                │
│   1628 │   │                                                                 │
│ ❱ 1629 │   │   response = await self._send_handling_auth(                    │
│   1630 │   │   │   request,                                                  │
│   1631 │   │   │   auth=auth,                                                │
│   1632 │   │   │   follow_redirects=follow_redirects,                        │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │             auth = <httpx.Auth object at 0x7fbc55f8e080>           │       │
│ │ follow_redirects = False                                           │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>    │       │
│ │           stream = False                                           │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1657 in             │
│ _send_handling_auth                                                          │
│                                                                              │
│   1654 │   │   │   request = await auth_flow.__anext__()                     │
│   1655 │   │   │                                                             │
│   1656 │   │   │   while True:                                               │
│ ❱ 1657 │   │   │   │   response = await self._send_handling_redirects(       │
│   1658 │   │   │   │   │   request,                                          │
│   1659 │   │   │   │   │   follow_redirects=follow_redirects,                │
│   1660 │   │   │   │   │   history=history,                                  │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │             auth = <httpx.Auth object at 0x7fbc55f8e080>                 │ │
│ │        auth_flow = <async_generator object Auth.async_auth_flow at       │ │
│ │                    0x7fbc547958c0>                                       │ │
│ │ follow_redirects = False                                                 │ │
│ │          history = []                                                    │ │
│ │          request = <Request('PATCH', 'http://example.org/upload')>       │ │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1694 in             │
│ _send_handling_redirects                                                     │
│                                                                              │
│   1691 │   │   │   for hook in self._event_hooks["request"]:                 │
│   1692 │   │   │   │   await hook(request)                                   │
│   1693 │   │   │                                                             │
│ ❱ 1694 │   │   │   response = await self._send_single_request(request)       │
│   1695 │   │   │   try:                                                      │
│   1696 │   │   │   │   for hook in self._event_hooks["response"]:            │
│   1697 │   │   │   │   │   await hook(response)                              │
│                                                                              │
│ ╭────────────────────────────── locals ──────────────────────────────╮       │
│ │ follow_redirects = False                                           │       │
│ │          history = []                                              │       │
│ │          request = <Request('PATCH', 'http://example.org/upload')> │       │
│ │             self = <httpx.AsyncClient object at 0x7fbc54b45570>    │       │
│ ╰────────────────────────────────────────────────────────────────────╯       │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/httpx/_client.py:1730 in             │
│ _send_single_request                                                         │
│                                                                              │
│   1727 │   │   │   )                                                         │
│   1728 │   │                                                                 │
│   1729 │   │   with request_context(request=request):                        │
│ ❱ 1730 │   │   │   response = await transport.handle_async_request(request)  │
│   1731 │   │                                                                 │
│   1732 │   │   assert isinstance(response.stream, AsyncByteStream)           │
│   1733 │   │   response.request = request                                    │
│                                                                              │
│ ╭──────────────────────────── locals ─────────────────────────────╮          │
│ │   request = <Request('PATCH', 'http://example.org/upload')>     │          │
│ │      self = <httpx.AsyncClient object at 0x7fbc54b45570>        │          │
│ │     start = 152.127313106                                       │          │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90> │          │
│ ╰─────────────────────────────────────────────────────────────────╯          │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/__init__.py:56 in       │
│ mocked_handle_async_request                                                  │
│                                                                              │
│   53 │   │   transport: httpx.AsyncHTTPTransport, request: httpx.Request     │
│   54 │   ) -> httpx.Response:                                                │
│   55 │   │   if options.should_mock(request):                                │
│ ❱ 56 │   │   │   return await mock._handle_async_request(transport, request) │
│   57 │   │   return await real_handle_async_request(transport, request)      │
│   58 │                                                                       │
│   59 │   monkeypatch.setattr(                                                │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      mock = <pytest_httpx._httpx_mock.HTTPXMock object at                │ │
│ │             0x7fbc54b46140>                                              │ │
│ │   options = <pytest_httpx._options._HTTPXMockOptions object at           │ │
│ │             0x7fbc54b44850>                                              │ │
│ │   request = <Request('PATCH', 'http://example.org/upload')>              │ │
│ │ transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>          │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:183 in   │
│ _handle_async_request                                                        │
│                                                                              │
│   180 │   │   │   │   │   response = await response                          │
│   181 │   │   │   │   return _unread(response)                               │
│   182 │   │                                                                  │
│ ❱ 183 │   │   self._request_not_matched(real_transport, request)             │
│   184 │                                                                      │
│   185 │   def _request_not_matched(                                          │
│   186 │   │   self,                                                          │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │       callback = None                                                    │ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54b46140>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/site-packages/pytest_httpx/_httpx_mock.py:191 in   │
│ _request_not_matched                                                         │
│                                                                              │
│   188 │   │   request: httpx.Request,                                        │
│   189 │   ) -> NoReturn:                                                     │
│   190 │   │   self._requests_not_matched.append(request)                     │
│ ❱ 191 │   │   raise httpx.TimeoutException(                                  │
│   192 │   │   │   self._explain_that_no_response_was_found(real_transport, r │
│   193 │   │   │   request=request,                                           │
│   194 │   │   )                                                              │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │ real_transport = <httpx.AsyncHTTPTransport object at 0x7fbc54b47d90>     │ │
│ │        request = <Request('PATCH', 'http://example.org/upload')>         │ │
│ │           self = <pytest_httpx._httpx_mock.HTTPXMock object at           │ │
│ │                  0x7fbc54b46140>                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
TimeoutException: No response can be found for PATCH request on 
http://example.org/upload with {'Content-Length': '524288'} headers amongst:
- Match HEAD request
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it 
again, refer to 
https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-
a-response-for-more-than-one-request

=============================== warnings summary ===============================
tests/chunked_uploads/test_upload_client_server.py: 10 warnings
tests/chunked_uploads/test_upload_endpoint.py: 8 warnings
tests/test_auth.py: 4 warnings
tests/upload/test_upload_five_gigazeroes.py: 4 warnings
tests/upload/test_upload_prefix.py: 4 warnings
  /usr/local/lib/python3.10/site-packages/quart/wrappers/response.py:335: DeprecationWarning: The 'charset' attribute is deprecated and will not be used in Werkzeug 2.4. Text in body and cookie data will always use UTF-8.
    bytes_data = data.encode(self.charset)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
---- generated xml file: /builds/infrastructure/obs-proxy/test-results.xml -----
=========================== short test summary info ============================
FAILED tests/chunked_uploads/test_upload_chunked.py::test_upload_chunked_timeout - AssertionError: Regex pattern did not match.
 Regex: 'Upload error at range bytes 2621440-3145727/4194304 .attempt 4.: Simulated timeout'
 Input: "Upload error at range bytes 524288-1048575/4194304 (attempt 4): No response can be found for PATCH request on http://example.org/upload with {'Patch-Content-Range': 'bytes 524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:\n- Match any request with {'Patch-Content-Range': 'bytes 2621440-3145727/4194304'} headers\n- Already matched any request with {'Content-Length': '524288'} headers\n\nIf you wanted to reuse an already matched response instead of registering it again, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-a-response-for-more-than-one-request"
FAILED tests/chunked_uploads/test_upload_chunked.py::test_upload_chunked_wrong_response - AssertionError: Regex pattern did not match.
 Regex: "Upload error at range bytes 2621440-3145727/4194304 .attempt 0.: .*418 I'm a teapot.*"
 Input: "Upload error at range bytes 524288-1048575/4194304 (attempt 4): No response can be found for PATCH request on http://example.org/upload with {'Patch-Content-Range': 'bytes 524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:\n- Match any request with {'Patch-Content-Range': 'bytes 2621440-3145727/4194304'} headers\n- Already matched any request with {'Content-Length': '524288'} headers\n\nIf you wanted to reuse an already matched response instead of registering it again, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-a-response-for-more-than-one-request"
FAILED tests/chunked_uploads/test_upload_chunked.py::test_upload_chunked_transient_server_error - AssertionError: Regex pattern did not match.
 Regex: 'Upload error at range bytes 2621440-3145727/4194304 .attempt 4.: .*500 Internal Server Error.*'
 Input: "Upload error at range bytes 524288-1048575/4194304 (attempt 4): No response can be found for PATCH request on http://example.org/upload with {'Patch-Content-Range': 'bytes 524288-1048575/4194304', 'Content-Length': '524288'} headers amongst:\n- Match any request with {'Patch-Content-Range': 'bytes 2621440-3145727/4194304'} headers\n- Already matched any request with {'Content-Length': '524288'} headers\n\nIf you wanted to reuse an already matched response instead of registering it again, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-a-response-for-more-than-one-request"
FAILED tests/chunked_uploads/test_upload_chunked.py::test_upload_chunked_complete - obs_proxy.chunked_uploads.client.ChunkedUploadError: Upload error at range bytes 524288-1048575/4194304 (attempt 4): No response can be found for PATCH request on http://example.org/upload with {'Content-Length': '524288'} headers amongst:
- Match HEAD request
- Already matched any request with {'Content-Length': '524288'} headers

If you wanted to reuse an already matched response instead of registering it again, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-a-response-for-more-than-one-request
ERROR tests/chunked_uploads/test_upload_chunked.py::test_upload_chunked_timeout - AssertionError: The following responses are mocked but not requested:
  - Match any request with {'Patch-Content-Range': 'bytes 2621440-3145727/4194304'} headers
  
  If this is on purpose, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-more-responses-than-what-will-be-requested
assert not [<pytest_httpx._request_matcher._RequestMatcher object at 0x7fbc55766e90>]
ERROR tests/chunked_uploads/test_upload_chunked.py::test_upload_chunked_wrong_response - AssertionError: The following responses are mocked but not requested:
  - Match any request with {'Patch-Content-Range': 'bytes 2621440-3145727/4194304'} headers
  
  If this is on purpose, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-more-responses-than-what-will-be-requested
assert not [<pytest_httpx._request_matcher._RequestMatcher object at 0x7fbc54ae1f60>]
ERROR tests/chunked_uploads/test_upload_chunked.py::test_upload_chunked_transient_server_error - AssertionError: The following responses are mocked but not requested:
  - Match any request with {'Patch-Content-Range': 'bytes 2621440-3145727/4194304'} headers
  
  If this is on purpose, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-more-responses-than-what-will-be-requested
assert not [<pytest_httpx._request_matcher._RequestMatcher object at 0x7fbc557a1570>]
ERROR tests/chunked_uploads/test_upload_chunked.py::test_upload_chunked_complete - AssertionError: The following responses are mocked but not requested:
  - Match HEAD request
  
  If this is on purpose, refer to https://github.com/Colin-b/pytest_httpx/blob/master/README.md#allow-to-register-more-responses-than-what-will-be-requested
assert not [<pytest_httpx._request_matcher._RequestMatcher object at 0x7fbc54b461d0>]
======= 4 failed, 26 passed, 30 warnings, 4 errors in 125.14s (0:02:05) ========
section_end:1735812145:step_script
section_start:1735812145:upload_artifacts_on_failure
Uploading artifacts for failed job
Uploading artifacts...
test-results.xml: found 1 matching artifact files and directories 
Uploading artifacts as "junit" to coordinator... 201 Created  id=3636261 responseStatus=201 Created token=glcbt-64
section_end:1735812145:upload_artifacts_on_failure
section_start:1735812145:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1735812146:cleanup_file_variables
ERROR: Job failed: exit code 1