From 24ac8d7fb0e7c5f6b55ead9c70b117d0e17c61be Mon Sep 17 00:00:00 2001 From: Abhik Sarkar Date: Fri, 5 Jun 2026 21:59:33 +0530 Subject: [PATCH 1/2] Upgrade redis to 7.4.9 --- build_scripts/update_redis_server.py | 2 +- screwdriver.yaml | 2 +- setup.cfg | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build_scripts/update_redis_server.py b/build_scripts/update_redis_server.py index 10c786f8..c4478b74 100755 --- a/build_scripts/update_redis_server.py +++ b/build_scripts/update_redis_server.py @@ -8,7 +8,7 @@ import tempfile -redis_version = os.environ.get('REDIS_VERSION', '6.2.14') +redis_version = os.environ.get('REDIS_VERSION', '7.4.9') url = f'http://download.redis.io/releases/redis-{redis_version}.tar.gz' diff --git a/screwdriver.yaml b/screwdriver.yaml index eeae92fb..1d3dabf8 100644 --- a/screwdriver.yaml +++ b/screwdriver.yaml @@ -3,7 +3,7 @@ shared: environment: CHANGELOG_FILENAME: docs/source/topic/changelog.md PACKAGE_DIRECTORY: redislite - REDIS_VERSION: '6.2.14' + REDIS_VERSION: '7.4.9' TOX_ENVLIST: py38,py39,py310,py311 steps: - postinit_os: build_scripts/update_redis_server.py diff --git a/setup.cfg b/setup.cfg index 65759b4e..c0f84eaa 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,7 +35,7 @@ project_urls = Documentation = https://redislite.readthedocs.io/en/latest/ Source = https://github.com/yahoo/redislite url = https://github.com/yahoo/redislite -version = 6.2.14 +version = 7.4.9 [options] install_requires= diff --git a/setup.py b/setup.py index 7787b674..ad1f4325 100755 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ BASEPATH = os.path.dirname(os.path.abspath(__file__)) REDIS_PATH = os.path.join(BASEPATH, 'redis.submodule') REDIS_SERVER_METADATA = {} -REDIS_VERSION = os.environ.get('REDIS_VERSION', '6.2.14') +REDIS_VERSION = os.environ.get('REDIS_VERSION', '7.4.9') REDIS_URL = f'http://download.redis.io/releases/redis-{REDIS_VERSION}.tar.gz' install_scripts = '' try: From 3490303f8bec201bd15df088e3ad7170aeb42e80 Mon Sep 17 00:00:00 2001 From: Abhik Sarkar Date: Fri, 5 Jun 2026 23:06:26 +0530 Subject: [PATCH 2/2] Update tests for redis 7.x replication and log changes - test_redis_log_attribute: match the 7.x startup log wording ("Ready to accept connections" replaces "The server is now ready to accept connections"). - test_slave: redis 7.x enables diskless replication by default, which delays the initial sync past the old fixed sleep. Set the master's repl-diskless-sync-delay to 0 and poll for replication instead. --- tests/test_client.py | 2 +- tests/test_slave.py | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 1442661a..47a8cfcf 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -313,7 +313,7 @@ def test_shutdown_race_condition(self): def test_redis_log_attribute(self): r = redislite.StrictRedis() - self.assertIn('The server is now ready to accept connections', r.redis_log) + self.assertIn('Ready to accept connections', r.redis_log) def test_redis_log_tail(self): r = redislite.StrictRedis() diff --git a/tests/test_slave.py b/tests/test_slave.py index 1cee61ed..0e154ae2 100644 --- a/tests/test_slave.py +++ b/tests/test_slave.py @@ -17,9 +17,18 @@ class TestRedisliteSlave(unittest.TestCase): def test_slave(self): - master = redislite.Redis(serverconfig={'port': '7000'}) + master = redislite.Redis( + serverconfig={'port': '7000', 'repl-diskless-sync-delay': '0'} + ) slave = redislite.Redis(serverconfig={'slaveof': 'localhost 7000'}) master.set('key', 'value') - time.sleep(.5) - value = slave.get('key').decode(encoding='UTF-8') - self.assertEquals(value, 'value') + + # Redis 7.x defaults to diskless replication, so wait for the sync rather than a fixed delay. + value = None + for _ in range(100): + raw = slave.get('key') + if raw is not None: + value = raw.decode(encoding='UTF-8') + break + time.sleep(0.1) + self.assertEqual(value, 'value')