From c08c456ec21f8437f44670b06adde241456642ad Mon Sep 17 00:00:00 2001 From: Vishal Bala Date: Thu, 2 Jul 2026 13:47:50 +0200 Subject: [PATCH] ci: pin RediSearch WORKERS to 0 to fix flaky redis:latest tests Redis 8.8 changed the default search WORKERS from 0 to a multithreaded background executor (to align with Valkey). With workers > 0, FT.SEARCH races against key/hash-field expiry and can return matched docs with nil field arrays instead of filtering them out, which intermittently fails the redis:latest CI matrix. Set --search-workers 0 on the test Redis container to run search in the foreground and avoid the race. This is already the default on the pinned 8.2/8.4 images, so it is a no-op there, and it is overridable via REDIS_SEARCH_WORKERS. The underlying server bug is being fixed upstream. Co-Authored-By: Claude Opus 4.8 --- tests/docker-compose.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index 18ea80e1..f53eb73a 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -4,7 +4,13 @@ services: ports: - "6379" environment: - - "REDIS_ARGS=--save '' --appendonly no" + # Pin the RediSearch worker pool to 0 (single-threaded, foreground + # execution). Redis 8.8 changed the default from 0 to a multithreaded + # background executor, which surfaces a race where FT.SEARCH can return + # nil fields for docs that expire mid-query -- the source of flaky + # redis:latest CI runs. WORKERS=0 avoids the race and is already the + # default on the pinned 8.2/8.4 images, so this is a no-op there. + - "REDIS_ARGS=--save '' --appendonly no --search-workers ${REDIS_SEARCH_WORKERS:-0}" deploy: replicas: 1 restart_policy: