summaryrefslogtreecommitdiff
path: root/tests/test_asyncio/test_connection.py
Commit message (Collapse)AuthorAgeFilesLines
* fix create single_connection_client from url (#2752)dvora-h2023-05-081-0/+6
|
* Optionally disable disconnects in read_response (#2695)Kristján Valur Jónsson2023-05-081-1/+1
| | | | | | | | | | | | | * Add regression tests and fixes for issue #1128 * Fix tests for resumable read_response to use "disconnect_on_error" * undo prevision fix attempts in async client and cluster * re-enable cluster test * Suggestions from code review * Add CHANGES
* Fixing cancelled async futures (#2666)Chayim2023-03-291-21/+0
| | | | | Co-authored-by: James R T <jamestiotio@gmail.com> Co-authored-by: dvora-h <dvora.heller@redis.com>
* AsyncIO Race Condition Fix (#2641)v4.5.3Chayim2023-03-221-0/+21
|
* Fix behaviour of async PythonParser to match RedisParser as for issue #2349 ↵Kristján Valur Jónsson2023-03-161-2/+0
| | | | | | | (#2582) * Allow data to drain from PythonParser after connection close. * Add Changes
* Fix issue 2349: Let async HiredisParser finish parsing after a ↵Kristján Valur Jónsson2023-02-061-0/+82
| | | | | | | | | | | | | Connection.disconnect() (#2557) * A failing unittest * Do not clear the redis-reader's state when we disconnect so that it can finish reading the final message * Test that reading a message of two chunks after a disconnect() works. * Add Changes * fix typos
* Fix issue 2540: Synchronise concurrent command calls to single-client mode. ↵Vivanov982023-01-291-0/+45
| | | | | (#2568) Co-authored-by: Viktor Ivanov <viktor@infogrid.io>
* Make PythonParser resumable (#2510)Kristján Valur Jónsson2023-01-051-7/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | * PythonParser is now resumable if _stream IO is interrupted * Add test for parse resumability * Clear PythonParser state when connection or parsing errors occur. * disable test for cluster mode. * Perform "closed" check in a single place. * Update tests * Simplify code. * Remove reduntant test, EOF is detected inside _readline() * Make syncronous PythonParser restartable on error, same as HiredisParser Fix sync PythonParser * Add CHANGES * isort * Move MockStream and MockSocket into their own files
* Remove the superflous SocketBuffer from asyncio PythonParser (#2418)Kristján Valur Jónsson2022-10-301-4/+5
| | | | | | | | | | | * Remove buffering from asyncio SocketBuffer and rely on on the underlying StreamReader * Skip the use of SocketBuffer in PythonParser * Remove SocketBuffer altogether * Code cleanup * Fix unittest mocking when SocketBuffer is gone
* Dev/no lock (#2308)Kristján Valur Jónsson2022-09-281-0/+4
| | | | | * Remove async lock in asyncio.Connection.read_response * Skip concurrent-commands test on non-pooled connections
* Drop python 3.6 support (#2306)dvora-h2022-07-271-4/+0
|
* Fix warnings and resource usage problems in asyncio unittests (#2258)Kristján Valur Jónsson2022-07-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use pytest-asyncio in auto mode Remove overly genereric `pytestmark=pytest.mark.asyncio` causing lots of warning noise * Use "Factories as Fixtures" test pattern for the `create_redis` fixture this fixture is now async, avoiding teardown problems with missing event loops. * Fix sporadic error on fast event loops, such as `--uvloop` * Close connection, even if "username" was in kwargs This fixes a resource usage warning in the async unittests. * Do async cleanup of acl passwords via a fixture * Remove unused import, fix whitespace * Fix test with missing "await" * Close pubsub objects after use in unittest Use a simple fixture where possible, otherwise manually call pubsub.close() * re-introduce `pytestmark=pytest.mark.asyncio` for python 3.6 * Use context manager to clean up connections in connection pool for unit tests * Provide asynccontextmanager for python 3.6 * make `test_late_subscribe()` more robuste * Catch a couple of additional leaked resources
* Use retry mechanism in async version of Connection objects (#2271)szumka2022-07-211-2/+51
|
* Add Async RedisCluster (#2099)Utkarsh Gupta2022-05-081-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Copy Cluster Client, Commands, Commands Parser, Tests for asyncio * Async Cluster Tests: Async/Await * Add Async RedisCluster * cluster: use ERRORS_ALLOW_RETRY from self.__class__ * async_cluster: rework redis_connection, initialize, & close - move redis_connection from NodesManager to ClusterNode & handle all related logic in ClusterNode class - use Locks while initializing or closing - in case of error, close connections instead of instantly reinitializing - create ResourceWarning instead of manually deleting client object - use asyncio.gather to run commands/initialize/close in parallel - inline single use functions - fix test_acl_log for py3.6 * async_cluster: add types * async_cluster: add docs * docs: update sphinx & add sphinx_autodoc_typehints * async_cluster: move TargetNodesT to cluster module * async_cluster/commands: inherit commands from sync class if possible * async_cluster: add benchmark script with aredis & aioredis-cluster * async_cluster: remove logging * async_cluster: inline functions * async_cluster: manage Connection instead of Redis Client * async_cluster/commands: optimize parser * async_cluster: use ensure_future & generators for gather * async_conn: optimize * async_cluster: optimize determine_slot * async_cluster: optimize determine_nodes * async_cluster/parser: optimize _get_moveable_keys * async_cluster: inlined check_slots_coverage * async_cluster: update docstrings * async_cluster: add concurrent test & use read_response/_update_moved_slots without lock Co-authored-by: Chayim <chayim@users.noreply.github.com>
* Add Async Support (#1899)Andrew Chen Wang2022-02-221-0/+64
Co-authored-by: Chayim I. Kirshen <c@kirshen.com> Co-authored-by: dvora-h <dvora.heller@redis.com>