Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Migrate final connection pool tests to Hypercorn #3213

Merged
merged 2 commits into from Nov 26, 2023

Conversation

pquentin
Copy link
Member

No description provided.

sethmlarson
sethmlarson previously approved these changes Nov 26, 2023
Copy link
Member

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@sethmlarson sethmlarson added the Skip Changelog Pull requests that don't require a changelog entry label Nov 26, 2023
@pquentin
Copy link
Member Author

pquentin commented Nov 26, 2023

Will need to investigate this:

____________ TestFileBodiesOnRetryOrRedirect.test_redirect_put_file ____________
urllib3.exceptions.ResponseError: too many redirects

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

Traceback (most recent call last):
  File "/home/runner/work/urllib3/urllib3/.nox/test-pypy/lib/pypy3.10/site-packages/_pytest/runner.py", line 341, in from_call
    result: Optional[TResult] = func()
  File "/home/runner/work/urllib3/urllib3/.nox/test-pypy/lib/pypy3.10/site-packages/_pytest/runner.py", line 262, in <lambda>
    lambda: ihook(item=item, **kwds), when=when, reraise=reraise
  File "/home/runner/work/urllib3/urllib3/.nox/test-pypy/lib/pypy3.10/site-packages/pluggy/_hooks.py", line 493, in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
  File "/home/runner/work/urllib3/urllib3/.nox/test-pypy/lib/pypy3.10/site-packages/pluggy/_manager.py", line 115, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/home/runner/work/urllib3/urllib3/.nox/test-pypy/lib/pypy3.10/site-packages/pluggy/_callers.py", line 152, in _multicall
    return outcome.get_result()
  File "/home/runner/work/urllib3/urllib3/.nox/test-pypy/lib/pypy3.10/site-packages/pluggy/_result.py", line 114, in get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/home/runner/work/urllib3/urllib3/.nox/test-pypy/lib/pypy3.10/site-packages/pluggy/_callers.py", line 77, in _multicall
    res = hook_impl.function(*args)
  File "/home/runner/work/urllib3/urllib3/.nox/test-pypy/lib/pypy3.10/site-packages/_pytest/runner.py", line 177, in pytest_runtest_call
    raise e
  File "/home/runner/work/urllib3/urllib3/.nox/test-pypy/lib/pypy3.10/site-packages/_pytest/runner.py", line 169, in pytest_runtest_call
    item.runtest()
  File "/home/runner/work/urllib3/urllib3/.nox/test-pypy/lib/pypy3.10/site-packages/_pytest/python.py", line 1792, in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  File "/home/runner/work/urllib3/urllib3/.nox/test-pypy/lib/pypy3.10/site-packages/pluggy/_hooks.py", line 493, in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
  File "/home/runner/work/urllib3/urllib3/.nox/test-pypy/lib/pypy3.10/site-packages/pluggy/_manager.py", line 115, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/home/runner/work/urllib3/urllib3/.nox/test-pypy/lib/pypy3.10/site-packages/pluggy/_callers.py", line 113, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "/home/runner/work/urllib3/urllib3/.nox/test-pypy/lib/pypy3.10/site-packages/pluggy/_callers.py", line 77, in _multicall
    res = hook_impl.function(*args)
  File "/home/runner/work/urllib3/urllib3/.nox/test-pypy/lib/pypy3.10/site-packages/_pytest/python.py", line 194, in pytest_pyfunc_call
    result = testfunction(**testargs)
  File "/home/runner/work/urllib3/urllib3/test/with_dummyserver/test_connectionpool.py", line 1363, in test_redirect_put_file
    resp = pool.urlopen(
  File "/home/runner/work/urllib3/urllib3/.nox/test-pypy/lib/pypy3.10/site-packages/urllib3/connectionpool.py", line 876, in urlopen
    return self.urlopen(
  File "/home/runner/work/urllib3/urllib3/.nox/test-pypy/lib/pypy3.10/site-packages/urllib3/connectionpool.py", line 876, in urlopen
    return self.urlopen(
  File "/home/runner/work/urllib3/urllib3/.nox/test-pypy/lib/pypy3.10/site-packages/urllib3/connectionpool.py", line 876, in urlopen
    return self.urlopen(
  File "/home/runner/work/urllib3/urllib3/.nox/test-pypy/lib/pypy3.10/site-packages/urllib3/connectionpool.py", line 905, in urlopen
    retries = retries.increment(method, url, response=response, _pool=self)
  File "/home/runner/work/urllib3/urllib3/.nox/test-pypy/lib/pypy3.10/site-packages/urllib3/util/retry.py", line 515, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=39429): Max retries exceeded with url: /redirect?target=/echo&status=307 (Caused by ResponseError('too many redirects'))
------------------------------ Captured log call -------------------------------
WARNING  urllib3.connectionpool:connectionpool.py:873 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPConnectionPool(host='localhost', port=39429): Read timed out. (read timeout=0.1)")': /redirect?target=/echo&status=307
WARNING  urllib3.connectionpool:connectionpool.py:873 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPConnectionPool(host='localhost', port=39429): Read timed out. (read timeout=0.1)")': /redirect?target=/echo&status=307
WARNING  urllib3.connectionpool:connectionpool.py:873 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPConnectionPool(host='localhost', port=39429): Read timed out. (read timeout=0.1)")': /redirect?target=/echo&status=307
FAILED test/with_dummyserver/test_connectionpool.py::TestFileBodiesOnRetryOrRedirect::test_redirect_put_file - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <async_generator object DataBody.__aiter__.<locals>._aiter at 0x7f88f6b3d6c0>

Traceback (most recent call last):
  File "/home/runner/work/urllib3/urllib3/.nox/test_brotlipy/lib/python3.12/site-packages/trio/_core/_asyncgens.py", line 95, in finalizer
    warnings.warn(
ResourceWarning: Async generator 'quart.wrappers.response.DataBody.__aiter__.<locals>._aiter' was garbage collected before it had been exhausted. Surround its use in 'async with aclosing(...):' to ensure that it gets cleaned up as soon as you're done using it.

@pquentin
Copy link
Member Author

OK I've fixed a timeout issue where we were hardcoding 0.1 instead of using LONG_TIMEOUT (see #1706 for more details). The async generator warning is quite mysterious to me and has not reoccurred. I would suggest merging like this, I'll keep an eye on those tests.

Please take another look.

@sethmlarson sethmlarson merged commit 2b8d9a8 into urllib3:main Nov 26, 2023
32 of 37 checks passed
@pquentin pquentin deleted the hypercorn-finish-connectionpool.py branch November 27, 2023 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog Pull requests that don't require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants