rq/tests
François Charlier 3e2e26e702
Add an exception handler for the pubsub thread (#2132)
* Add an exception handler for the pubsub thread

After a connection error to Redis the pubsub thread was stopped and the
worker could not receive commands anymore.

This commit adds an exception handler for the thread that adds a log
message and ignores `redis.exceptions.ConnectionError`. Any other
exception is re-raised.

redis-py internal mechanism allows the pubsub thread to recover its
connection and reinstall the pubsub channel subscription to allow the
worker to receive commands again after connection errors.

It tries to behave the same as the main worker loop retry mechanism but
without the backoff wait factor.

Fixes #1836
Fixes #2070

* Add test for untested line, improve logging and comments

Add *args & **kwargs to tests.fixtures.raise_exc to pass tests with Python 3.7
2024-10-17 11:15:47 +07:00
..
config_files Delete legacy.py (#2083) 2024-05-02 08:20:41 +07:00
ssl_config Fix RQScheduler when run with SSL connection (#1383) 2020-11-27 07:27:30 +07:00
Dockerfile Store project metadata in pyproject.toml (PEP 621) (#1952) 2024-02-24 10:07:56 +07:00
__init__.py Remove RQTestCase.testconn (#2109) 2024-08-04 10:11:47 +07:00
fixtures.py Add an exception handler for the pubsub thread (#2132) 2024-10-17 11:15:47 +07:00
test.json Deprecate current connection (#2043) 2024-02-21 07:37:15 +07:00
test_callbacks.py Fix bug with stopped callback in enqueue_many (#1954) 2024-02-24 09:51:20 +07:00
test_cli.py Deprecate current connection (#2043) 2024-02-21 07:37:15 +07:00
test_commands.py Add an exception handler for the pubsub thread (#2132) 2024-10-17 11:15:47 +07:00
test_connection.py Deprecate current connection (#2043) 2024-02-21 07:37:15 +07:00
test_decorator.py Deprecate current connection (#2043) 2024-02-21 07:37:15 +07:00
test_dependencies.py Implement TTL for deferred jobs (#2111) 2024-08-11 19:23:28 +07:00
test_executions.py RQ execution fixes (#2128) 2024-10-02 09:13:13 +07:00
test_fixtures.py Deprecate current connection (#2043) 2024-02-21 07:37:15 +07:00
test_group.py Remove RQTestCase.testconn (#2109) 2024-08-04 10:11:47 +07:00
test_helpers.py Update linting configuration (#1915) 2023-05-17 23:19:14 +07:00
test_intermediate_queue.py Remove RQTestCase.testconn (#2109) 2024-08-04 10:11:47 +07:00
test_job.py Update Job.get_status and Job.restore to consistently return JobStatus Enum (#2039) 2024-05-26 09:37:55 +07:00
test_queue.py Register queue also for deferred job (#2108) 2024-07-18 09:42:21 +07:00
test_registry.py Allow to get job count and job IDs without cleanup (#2133) 2024-10-17 11:14:54 +07:00
test_results.py Removed utils.utcnow() (#2056) 2024-03-11 19:44:12 +07:00
test_retry.py Deprecate current connection (#2043) 2024-02-21 07:37:15 +07:00
test_scheduler.py Deprecate current connection (#2043) 2024-02-21 07:37:15 +07:00
test_serializers.py Update linting configuration (#1915) 2023-05-17 23:19:14 +07:00
test_timeouts.py Deprecate current connection (#2043) 2024-02-21 07:37:15 +07:00
test_utils.py [AWS Elasticache Serverless Redis] Handle redis servers that return non-string versions (#2131) 2024-10-13 07:09:13 +07:00
test_worker.py Fix flaky tests 2024-10-13 07:27:23 +07:00
test_worker_pool.py Set workerpool with_scheduler defaults to True (#2027) 2024-02-24 09:50:26 +07:00
test_worker_registration.py Fix test_clean_large_registry 2024-04-27 15:00:42 +07:00