summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Mark `TOPK.COUNT` as deprecated (#2363)dvora-h2022-09-042-12/+16
| | | | | * deprecate * linters
* Adding reserve as an alias for create, so that we have BF.RESERVE and ↵Chayim2022-08-301-0/+15
| | | | | | | | | CF.RESERVE accuratenly supported (#2331) * Adding reserve as an alias for create, so that we have BF.RESERVE accuratenly supported * add reserve to cf commands Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* Handle auth errors for newer versions of Redis. (#2325) (#2329)Luca Cillario2022-08-302-9/+45
|
* fix test (#2358)dvora-h2022-08-252-1/+4
|
* Be more strict about url scheme parsing (#2343)Klaas van Schelven2022-08-211-0/+8
| | | | | | | | | | The error message implied that urls had to start with `scheme://`. However, if the double slash was left out, the url parsed just fine and the part that was ostensibly intended to be the hostname ended up as part of the path, whereas the default (localhost) would be used for the hostname. This commit makes the check as strict as the error message implies by including a check for the double slash. Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* Add BITFIELD_RO (#2340)Alibi2022-08-212-0/+26
|
* Fix GRAPH.LIST & TDIGEST.QUANTILE tests (#2335)dvora-h2022-08-144-14/+14
| | | | | | | | | * fix graph list_keys test * async test * fix tdigest.quantile * fix
* Add support for WITHSUFFIXTRIE to FT.CREATE (#2324)v4.4.0rc1dvora-h2022-08-042-0/+48
| | | | | | | * withsuffixtrie * Update test_search.py * fix
* Add TDIGEST.TRIMMED_MEAN (#2300)Alibi2022-08-041-0/+11
| | | | | | | | | | | * Add tdigest trimmed mean command with test * Add skip version for test * add to module callbacks Co-authored-by: Alibi Shalgymbay <a.shalgymbay@mycar.kz> Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com> Co-authored-by: dvora-h <dvora.heller@redis.com>
* Search test - Ignore order of the items in the response (#2322)dvora-h2022-08-042-2/+2
| | | | | * fix test * async test
* Support TDIGEST.MERGESTORE and make compression optional on TDIGEST.CREATE ↵dvora-h2022-08-022-0/+26
| | | | | | | | | | | (#2319) * support 2.4 * async test * skip tests * linters
* Fix async SEARCH pipeline (#2316)dvora-h2022-08-021-1/+20
| | | | | * fix search async pipeline * newline
* Replace `ensure_future` with `create_task` (#2311)dvora-h2022-08-021-5/+1
| | | | | * Replace `ensure_future` with `create_task` * linters
* Add support for `TDIGEST.QUANTILE` extensions (#2317)dvora-h2022-08-022-14/+34
| | | | | | | | | * Add support for TDIGEST.QUANTILE extensions * linters * linters & utils * Update test_bloom.py
* Fix timezone handling for datetime to unixtime conversions (#2213)joe2022-08-022-7/+6
| | | | | | | | | | | | | | * Fix timezone handling for datetime to unixtime conversions datetime objects are supported to set expire, these can have timezones. mktime was used to convert these to unixtime. mktime in Python however is not timezone aware, it expects the input to be UTC and redis-py did not convert the datetime timestamps to UTC before calling mktime. This can lead to: 1) Setting incorrect expire times because the input datetime object has a timezone but is passed to mktime without converting to UTC first. 2) When the datetime timestamp is within DST, mktime fails with "OverflowError: mktime argument out of range" because UTC doesn't have DST. This depends on libc versions. * linters Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* Add support for async GRAPH module (#2273)dvora-h2022-07-281-0/+503
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add support for async graph * linters * fix docstring * Use retry mechanism in async version of Connection objects (#2271) * fix is_connected (#2278) * fix: workaround asyncio bug on connection reset by peer (#2259) Fixes #2237 * Fix crash: key expire while search (#2270) * fix expire while search * sleep * docs: Fix a few typos (#2274) * docs: Fix a few typos There are small typos in: - redis/cluster.py - redis/commands/core.py - redis/ocsp.py - tests/test_cluster.py Fixes: - Should read `validity` rather than `valididy`. - Should read `reinitialize` rather than `reinitilize`. - Should read `farthest` rather than `farest`. - Should read `commands` rather than `comamnds`. * Update core.py * async_cluster: fix concurrent pipeline (#2280) - each pipeline should create separate stacks for each node * Add support for TIMESERIES 1.8 (#2296) * Add support for timeseries 1.8 * fix info * linters * linters * fix info test * type hints * linters * Remove verbose logging from `redis-py/redis/cluster.py` (#2238) * removed the logging module and its corresponding methods * updated CHANGES * except block for RedisClusterException and BusyLoadingError removed * removed unused import (redis.exceptions.BusyLoadingError) * empty commit to re-trigger Actions workflow * replaced BaseException with Exception * empty commit to re-trigger Actions workflow * empty commit to re-trigger Actions workflow * redundant logic removed * re-trigger pipeline * reverted changes * re-trigger pipeline * except logic changed * redis stream example (#2269) * redis stream example * redis stream example on docs/examples.rst Co-authored-by: pedro.frazao <perl.pf@netcf.org> * Fix: `start_id` type for `XAUTOCLAIM` (#2257) * Changed start_id type for xautoclaim * Added to changes Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com> * Doc add timeseries example (#2267) * DOC add timeseries example * DOC add timeseries examples * Apply suggestions * Fix typo Detention period => Retention period Co-authored-by: Gauthier Imbert <gauthier@PC17> * Fix warnings and resource usage problems in asyncio unittests (#2258) * 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 * Graph - add counters for removed labels and properties (#2292) * grpah - add counters for removed labels and properties * added mock graph result set statistics * docstrings for graph result set statistics * format * isort * moved docstrings into functions * cleaning up the readme and moving docs into readthedocs (#2291) * cleaning up the readme and moving docs into readthedocs * examples at the end as per pr comments * async_cluster: fix max_connections/ssl & improve args (#2217) * async_cluster: fix max_connections/ssl & improve args - set proper connection_class if ssl = True - pass max_connections/connection_class to ClusterNode - recreate startup_nodes to properly initialize - pass parser_class to Connection instead of changing it in on_connect - only pass redis_connect_func if read_from_replicas = True - add connection_error_retry_attempts parameter - skip is_connected check in acquire_connection as it is already checked in send_packed_command BREAKING: - RedisCluster args except host & port are kw-only now - RedisCluster will no longer accept unknown arguments - RedisCluster will no longer accept url as an argument. Use RedisCluster.from_url - RedisCluster.require_full_coverage defaults to True - ClusterNode args except host, port, & server_type are kw-only now * async_cluster: remove kw-only requirement from client Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com> * fix review comments * fix * fix review comments * fix review comments Co-authored-by: Chayim <chayim@users.noreply.github.com> Co-authored-by: szumka <106675199+szumka@users.noreply.github.com> Co-authored-by: Mehdi ABAAKOUK <sileht@sileht.net> Co-authored-by: Tim Gates <tim.gates@iress.com> Co-authored-by: Utkarsh Gupta <utkarshgupta137@gmail.com> Co-authored-by: Nial Daly <34862917+nialdaly@users.noreply.github.com> Co-authored-by: pedrofrazao <603718+pedrofrazao@users.noreply.github.com> Co-authored-by: pedro.frazao <perl.pf@netcf.org> Co-authored-by: Антон Безденежных <gamer392@yandex.ru> Co-authored-by: Iglesys <g.imbert34@gmail.com> Co-authored-by: Gauthier Imbert <gauthier@PC17> Co-authored-by: Kristján Valur Jónsson <sweskman@gmail.com> Co-authored-by: DvirDukhan <dvir@redis.com>
* automatically reconnect pubsub when reading messages in blocking mode (#2281)Kristján Valur Jónsson2022-07-274-6/+280
| | | | | | | | | | | | | | | | * optimistic default info on test sessionstart. Makes test discovery work, even without a redis connection. * Add unittests verifying that (non-async) PubSub will automatically reconnect * Add tests for asyncio pubsub subsciription auto-reconnect * automatically connect for blocking reads (asyncio) * fix automatic connect on blocking pubsub read (non-async) * lint & format * Perform `connect()` call in PubSub code rather than `read_response`.
* Drop python 3.6 support (#2306)dvora-h2022-07-2715-120/+14
|
* async_cluster: fix max_connections/ssl & improve args (#2217)Utkarsh Gupta2022-07-271-32/+178
| | | | | | | | | | | | | | | | | | | | | | * async_cluster: fix max_connections/ssl & improve args - set proper connection_class if ssl = True - pass max_connections/connection_class to ClusterNode - recreate startup_nodes to properly initialize - pass parser_class to Connection instead of changing it in on_connect - only pass redis_connect_func if read_from_replicas = True - add connection_error_retry_attempts parameter - skip is_connected check in acquire_connection as it is already checked in send_packed_command BREAKING: - RedisCluster args except host & port are kw-only now - RedisCluster will no longer accept unknown arguments - RedisCluster will no longer accept url as an argument. Use RedisCluster.from_url - RedisCluster.require_full_coverage defaults to True - ClusterNode args except host, port, & server_type are kw-only now * async_cluster: remove kw-only requirement from client Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* Graph - add counters for removed labels and properties (#2292)DvirDukhan2022-07-261-0/+47
| | | | | | | | | | | | | * grpah - add counters for removed labels and properties * added mock graph result set statistics * docstrings for graph result set statistics * format * isort * moved docstrings into functions
* Fix warnings and resource usage problems in asyncio unittests (#2258)Kristján Valur Jónsson2022-07-2618-278/+318
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Add support for TIMESERIES 1.8 (#2296)dvora-h2022-07-241-2/+241
| | | | | | | | | | | | | | | * Add support for timeseries 1.8 * fix info * linters * linters * fix info test * type hints * linters
* async_cluster: fix concurrent pipeline (#2280)Utkarsh Gupta2022-07-241-0/+8
| | | - each pipeline should create separate stacks for each node
* docs: Fix a few typos (#2274)Tim Gates2022-07-241-1/+1
| | | | | | | | | | | | | | | | | * docs: Fix a few typos There are small typos in: - redis/cluster.py - redis/commands/core.py - redis/ocsp.py - tests/test_cluster.py Fixes: - Should read `validity` rather than `valididy`. - Should read `reinitialize` rather than `reinitilize`. - Should read `farthest` rather than `farest`. - Should read `commands` rather than `comamnds`. * Update core.py
* Fix crash: key expire while search (#2270)dvora-h2022-07-241-0/+14
| | | | | * fix expire while search * sleep
* Use retry mechanism in async version of Connection objects (#2271)szumka2022-07-212-2/+88
|
* Fix `XAUTOCLAIM` to return the full response (#2252)dvora-h2022-06-271-2/+2
| | | | | * fix parse_xautoclaim * linters
* Split incorrect mark into two separate marks (#2253)Kristján Valur Jónsson2022-06-271-4/+9
|
* late eval of the skip condition (#2248)Kristján Valur Jónsson2022-06-274-4/+7
| | | | | | | | | | * late eval of the skip condition at module import time, the REDIS_INFO dict hasn't been initialized. * Store REDIS_INFO in config object, where it is available from condition strings * Fix comparson of time You can't test rounded values for equalness, since they may fall each on a different side of 0.5. It is better to test their absolute difference for a certain tolerance, in this case 1.0 which is the intent of the original round.
* Added dynamic_startup_nodes configuration to RedisCluster. (#2244)Bar Shaul2022-06-231-1/+22
| | | | | | | | | * Added dynamic_startup_nodes configuration to RedisCluster. By default, uses only the initial passed startup nodes to refresh the cluster topology. If set to true, sets the startup nodes to all of the discovered nodes. * Added RedisCluster specific options to the README file and updated CHANGES * Fixed timeout_error_topology_refresh test Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* Reuse the old nodes' connections when a cluster topology refresh is being ↵Bar Shaul2022-06-232-3/+47
| | | | | | | | | | | | | done (#2235) * A fix was made to reuse the old nodes' connections when a cluster topology refresh is being done * Fixed RedisCluster to immediately raise AuthenticationError * Updated CHANGES * Fixed cluster async bgsave test to ignore "bgsave already in progress" error * Fixed linters
* Fix retries in async mode (#2180)Eric Lemoine2022-06-191-3/+35
| | | | | | | | | * Avoid mutating a global retry_on_error list * Make retries config consistent in sync and async * Fix async retries * Add new TestConnectionConstructorWithRetry tests
* async_cluster: fix simultaneous initialize (#2231)Utkarsh Gupta2022-06-191-3/+5
| | | - close startup_nodes too during client.close(), in case they are different
* SHUTDOWN - add support for the new NOW, FORCE and ABORT modifiers (#2150)dvora-h2022-06-011-0/+14
| | | | | | | | | | | | | | | * add support for NOW, FORCE and ABORT modifiers * linters * test * linters * test params * fix tests Co-authored-by: Chayim <chayim@users.noreply.github.com>
* Made sync lock consistent and added types to it (#2137)Anas2022-06-011-0/+20
| | | | | | | | | * Made sync lock consistent and added types to it * Made linters happy * Fixed cluster client lock signature Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* Add `query_params` to FT.PROFILE (#2198)dvora-h2022-06-011-0/+24
| | | | | | | * ft.profile query_params * fix pr comments * type hints
* Fix tests for Redis 7 (#2182)dvora-h2022-05-317-73/+91
| | | | | * fix tests * async
* async_cluster: add pipeline support (#2199)Utkarsh Gupta2022-05-302-4/+257
| | | Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* update black to 22.3.0 (#2171)Utkarsh Gupta2022-05-3017-345/+107
|
* async_cluster: add/update typing (#2195)Utkarsh Gupta2022-05-301-26/+9
| | | | | | | * async_cluster: add/update typing * async_cluster: update cleanup_kwargs with kwargs from async Connection * async_cluster: properly remove old nodes
* set default response_callbacks to redis.asyncio.cluster.ClusterNode (#2201)rapidia2022-05-301-0/+5
| | | | | | | | | * set default response_callbacks to redis.asyncio.cluster.ClusterNode * add test case for ClusterNode class * fix lint error * merge test case into `test_startup_nodes`
* Support CF.MEXISTS + Clean bf/commands.py (#2184)Avital Fine2022-05-231-0/+1
| | | | | | | * Support CF.MEXISTS * Clean bf/commands.py Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* Fix Linting and Test Failures (#2191)Greg Melton2022-05-232-5/+5
| | | | | | | * force triggering pr pipeline * fix lint error * https://github.com/RedisJSON/RedisJSON/pull/721 no longer clears strings or boolean scalars
* fix incorrect test (#2177)Avital Fine2022-05-161-12/+13
| | | | | * fix incorrect test * Fix types
* Get command keys for subcommands (#2170)dvora-h2022-05-082-2/+2
| | | | | * parse subcommands * fix tests
* Add support for CLUSTER SHARDS (#2151)dvora-h2022-05-081-0/+23
| | | | | | | | | * Add support for CLUSTER SHARDS * linters * add docstring * linters
* Add support for COMMAND LIST (#2149)dvora-h2022-05-081-0/+10
| | | | | * Add support for COMMAND LIST * style change
* Add Async RedisCluster (#2099)Utkarsh Gupta2022-05-089-130/+2411
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 unittest for PubSub.connect() (#2167)Kristján Valur Jónsson2022-05-081-0/+82
| | | | | * Add unittest for PubSub reconnect * fix linting
* ACL SETUSER - add selectors and key based permissions (#2161)dvora-h2022-05-032-4/+36
| | | | | | | * acl setuser * async tests Co-authored-by: Chayim <chayim@users.noreply.github.com>