summaryrefslogtreecommitdiff
path: root/tests/test_multiprocessing.py
Commit message (Collapse)AuthorAgeFilesLines
* Added black and isort (#1734)Anas2021-11-301-38/+40
|
* Pyupgrade + flynt + f-strings (#1759)Aarni Koskela2021-11-301-5/+2
| | | @akx Thank you so much for this! Thanks again for introducing me to a new tool that I'm sliding into my workflow as well.
* Unit test fixes to carry pytest options through all tests (#1696)Chayim2021-11-101-4/+7
|
* Remove support for end-of-life Python 2.7 (#1318)Jon Dufresne2020-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove support for end-of-life Python 2.7 Python 2.7 is end of life. It is no longer receiving bug fixes, including for security issues. Python 2.7 went EOL on 2020-01-01. For additional details on support Python versions, see: Supported: https://devguide.python.org/#status-of-python-branches EOL: https://devguide.python.org/devcycle/#end-of-life-branches Removing support for EOL Pythons will reduce testing and maintenance resources while allowing the library to move towards a modern Python 3 style. Python 2.7 users can continue to use the previous version of redis-py. Was able to simplify the code: - Removed redis._compat module - Removed __future__ imports - Removed object from class definition (all classes are new style) - Removed long (Python 3 unified numeric types) - Removed deprecated __nonzero__ method - Use simpler Python 3 super() syntax - Use unified OSError exception - Use yield from syntax Co-authored-by: Andy McCurdy <andy@andymccurdy.com>
* Pass the master hostname to testsAndrew Brookins2020-07-091-8/+8
|
* better thread-safety for ConnectionPool (#1270)Andy McCurdy2020-01-301-1/+1
| | | Better thread and fork safety for ConnectionPool and BlockingConnectionPool
* Compare numbers using '==' instead of 'is' (#1245)Jon Dufresne2019-11-121-5/+5
| | | | | | While numbers are frequently singletons as an optimization, it is not guaranteed by the language specification. Fixes flake8 error: F632 use ==/!= to compare str, bytes, and int literals
* use a multi-connection client for multiprocess testsAndy McCurdy2019-07-291-0/+12
|
* Improve how connection pools operate in forked/child proceeses.Andy McCurdy2019-01-311-21/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes a process with an active connection to Redis forks and creates child processes taht also want to talk to Redis. Prior to this change there were a number of potential conflicts that could cause this to fail. Retrieving a connection from the pool and releasing a connection back to the pool check the current proceeses PID. If it's different than the PID that created the pool, reset() is called to get a fresh set of connections for the current process. However in doing so, pool.disconnect() was caused which closes the file descriptors that the parent may still be using. Further when the available_connections and in_use_connections lists are reset, all of those connections inherited from the parent are GC'd and the connection's `__del__` was called, which also closed the socket and file descriptor. This change prevents pool.disconnect() from being called when a pid is changed. It also removes the `__del__` destructor from connections. Neither of these are necessary or practical. Child processes still reset() their copy of the pool when first accessed causing their own connections to be created. `ConnectionPool.disconnect()` now checks the current process ID so that a child or parent can't disconnect the other's connections. Additionally, `Connection.disconnect()` now checks the current process ID and only calls `socket.shutdown()` if `disconnect()` is called by the same process that created the connection. This allows for a child process that inherited a connection to call `Connection.disconnect()` and not shutdown the parent's copy of the socket. Fixes #863 Fixes #784 Fixes #732 Fixes #1085 Fixes #504
* update test to expect errorsAlexey Popravka2019-01-031-5/+8
|
* Add failing tests to show difference between protocol parsers on_disconnectAlexey Popravka2019-01-031-0/+127
implementation/behavior (related to #1085). When hiredis is installed and HiredisParser is used (implicitly), connection can not be securily shared between process forks.