Skip to content

[2.8] [MOD-11611] fix test_vecsim:TestTimeoutReached #6909

Merged
redisearch-backport-pull-request[bot] merged 1 commit into2.8from
backport-6904-to-2.8
Sep 28, 2025
Merged

[2.8] [MOD-11611] fix test_vecsim:TestTimeoutReached #6909
redisearch-backport-pull-request[bot] merged 1 commit into2.8from
backport-6904-to-2.8

Conversation

@redisearch-backport-pull-request
Copy link
Contributor

@redisearch-backport-pull-request redisearch-backport-pull-request bot commented Sep 28, 2025

Description

Backport of #6904 to 2.8.


Note

Adjust TestTimeoutReached to use fixed K=1000 for no-timeout KNN and drop no-timeout success checks for range and hybrid queries, keeping only timeout failure checks.

  • Tests (tests/pytests/test_vecsim.py):
    • TestTimeoutReached.run_long_queries:
      • Introduce large_k = 1000; use it for no-timeout KNN (LIMIT/K) and assert result count accordingly.
      • Remove no-timeout success assertions for range queries and hybrid modes; retain timeout=1 failure expectations.

Written by Cursor Bugbot for commit 7beb820. This will update automatically on new commits. Configure here.

* test: update KNN query to use large_k and remove redundant checks

* revert unnecessary changes

(cherry picked from commit 8e2dd9b)
'PARAMS', 4, 'K', large_k, 'vec_param', query_vec.tobytes(),
'TIMEOUT', 0)
self.env.assertEqual(res[0], n_vec)
self.env.assertEqual(res[0], large_k)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Inconsistent KNN Test Parameters

The FT.SEARCH KNN tests use inconsistent K and LIMIT parameters. The no-timeout test uses large_k (1000), but the timeout test still uses n_vec (a much larger value). This means the tests aren't comparing the same query, which makes the timeout test unreliable.

Fix in Cursor Fix in Web

@codecov
Copy link

codecov bot commented Sep 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.49%. Comparing base (2cf1600) to head (7beb820).
⚠️ Report is 1 commits behind head on 2.8.

Additional details and impacted files
@@            Coverage Diff             @@
##              2.8    #6909      +/-   ##
==========================================
- Coverage   87.50%   87.49%   -0.01%     
==========================================
  Files         203      203              
  Lines       35634    35634              
==========================================
- Hits        31181    31178       -3     
- Misses       4453     4456       +3     
Flag Coverage Δ
flow 81.81% <ø> (-0.22%) ⬇️
unit 42.75% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@redisearch-backport-pull-request redisearch-backport-pull-request bot added this pull request to the merge queue Sep 28, 2025
Merged via the queue into 2.8 with commit e4de255 Sep 28, 2025
14 checks passed
@redisearch-backport-pull-request redisearch-backport-pull-request bot deleted the backport-6904-to-2.8 branch September 28, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant