Repository navigation
Stabilize search-on-timeout FAIL tests against worker-thread race - #4721
Merged
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 28211db. Configure here.
ggivo
reviewed
Sep 23, 2026
ggivo
left a comment
Collaborator
There was a problem hiding this comment.
LGTM,
Will suggest leaving test running for all Redis versions, if not, causing a delay in CI. Using @SinceRedisVersion implies it is availble/compatible with the given version
Otherwise, it's probably better to introduce a dedicated "slow" test job
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
The
searchOnTimeoutFailReturnsError/aggregateOnTimeoutFailReturnsErrortests fail nightly against Redis unstable since 2026-08-27. As of RediSearch/RediSearch#10961, theFAILon-timeout policy is enforced by a blocked-client timeout callback racing the worker thread running the query β confirmed as intended behavior in RediSearch#11274: when the worker wins, an over-budget query returns full results instead of an error. With 10k documents the query overran the 1ms timeout by only a few milliseconds, leaving the outcome to scheduling jitter. RaisingON_TIMEOUT_DOC_COUNTto 100k gives a ~200x runtime-to-timeout margin so the callback deterministically wins.Key Decisions & Assumptions
TIMEOUT 1, rather than forcingsearch-workers 0(inline execution sidesteps the race).Testing
Test-only change, verified via redis-cli against the failing image (
unstable-33278213642-debian): at 100k docs the FAIL error returned 50/50 (search) and 20/20 (aggregate), versus 1/10 at 10k. The shared fixture also serves the RETURN-policy warning tests, which remain valid.Note
Low Risk
Test-only changes to search timeout fixtures; no production client or runtime behavior is modified.
Overview
Stabilizes RediSearch
search-on-timeoutFAIL integration tests by indexing 100k documents forsearchOnTimeoutFailReturnsErrorandaggregateOnTimeoutFailReturnsError, while RETURN warning tests still use 10k.The shared helpers
populateOnTimeoutIndexandtimingOutSearchParamsnow take a document count so FAIL and RETURN scenarios can use different index sizes. New javadoc documents that withsearch-workers > 0, the FAIL policy depends on a race between the blocked-client timeout callback and the query workerβqueries that only slightly exceed the 1ms limit may still succeed, which made the old 10k setup flaky on Redis unstable.Reviewed by Cursor Bugbot for commit 7982373. Bugbot is set up for automated code reviews on this repo. Configure here.