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

Fix typo in ConnectionPool and AsyncConnectionPool #908

Merged
merged 2 commits into from
May 17, 2024

Conversation

n-thumann
Copy link
Contributor

Summary

This PR fixes a typo in the ConnectionPool and AsyncConnectionPool classes.

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

@tomchristie
Copy link
Member

Oh great, thanks.
And you've nudged a flaky test as well.
I wonder what that's about?

@tomchristie
Copy link
Member

Bumped into a flaky test...

______________ test_connection_pool_timeout_during_request[trio] _______________

    @pytest.mark.anyio
    async def test_connection_pool_timeout_during_request():
        """
        An async timeout when writing an HTTP/1.1 response on the connection pool
        should leave the pool in a consistent state.
    
        In this case, that means the connection will become closed, and no
        longer remain in the pool.
        """
        network_backend = SlowWriteBackend()
        async with httpcore.AsyncConnectionPool(network_backend=network_backend) as pool:
            with anyio.move_on_after(0.01):
                await pool.request("GET", "http://example.com/")
>           assert not pool.connections
E           AssertionError: assert not [<AsyncHTTPConnection ['[http://example.com:80](http://example.com/)', HTTP/1.1, NEW, Request Count: 0]>]
E            +  where [<AsyncHTTPConnection ['[http://example.com:80](http://example.com/)', HTTP/1.1, NEW, Request Count: 0]>] = <AsyncConnectionPool [Requests: 0 active, 0 queued | Connections: 1 active, 0 idle]>.connections

tests/test_cancellations.py:111: AssertionError

@karpetrosyan karpetrosyan merged commit c96fdf7 into encode:master May 17, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants