Skip to content

test: series key named like an option keyword is not parsed as that option in TS.RANGE (MOD-15893) - #2069

Merged
gabsow merged 3 commits into
masterfrom
tom.gabsow/MOD-15893-range-keyword-key-regression-test
Nov 2, 2026
Merged

gabsow merged 3 commits into
masterfrom
tom.gabsow/MOD-15893-range-keyword-key-regression-test

Conversation

@gabsow

@gabsow gabsow commented Jun 16, 2026 •

Copy link
Copy Markdown
Collaborator

What

Adds a regression test (test_keyword_named_key_not_misparsed in tests/flow/test_ts_range.py) guarding the parsing fix from #2052 (MOD-15893, "Scope TS.RANGE/NRANGE option parsing past the key block").

Why

Before #2052, the single-key range option sub-parsers located keywords by scanning the entire argv. Because RMUtil_ArgIndex matches case-insensitively, a TS.RANGE/TS.REVRANGE whose series key was named like an option keyword (ALIGN, COUNT, LATEST, AGGREGATION, FILTER_BY_VALUE, FILTER_BY_TS) had its key matched as that option, and the following token was consumed as the option's value — e.g. a key literally named align matched the ALIGN keyword and ate the fromTimestamp as the alignment value.

#2052 fixed this by scoping option scanning to argv + start_index (after the key). The fix had no regression test, which is why the latent bug only surfaced in the external Jedis suite (TimeSeriesCommandsTestBase#align, which named its key align). Per product this is a bug fix, not a breaking change.

How it's tested

Equivalence guard: a series keyed by an option keyword must return exactly what an identically populated control series returns, across TS.RANGE/TS.REVRANGE and the affected options. Plus explicit post-fix values locked in for the align-named key:

Query (key align, AGGREGATION COUNT 10) Expected
no ALIGN (0,2),(10,1),(20,1)
ALIGN start (1,2),(11,1),(21,1)
ALIGN end (0,2),(10,1),(20,1)
ALIGN 5 (0,2),(5,1),(25,1)

Passes on all topologies (standalone, slaves, AOF, AOF+slaves, OSS cluster).

🤖 Generated with Claude Code


Note

Low Risk
Adds flow tests only; no runtime or parsing logic changes in this diff.

Overview
Adds test_keyword_named_key_not_misparsed in tests/flow/test_ts_range.py so the #2052 / MOD-15893 fix stays covered: series keys named like TS.RANGE / TS.REVRANGE options (align, count, latest, etc.) must not be parsed as those options.

The test compares a control series to copies keyed by each risky name across TS.RANGE and TS.REVRANGE, with queries that exercise aggregation, ALIGN, COUNT, FILTER_BY_*, and LATEST. It also pins expected aggregated results for a key named align, matching the Jedis scenario where a key named align was mistaken for ALIGN.

Test-only change — no module or parser edits in this PR.

Reviewed by Cursor Bugbot for commit 0407498. Bugbot is set up for automated code reviews on this repo. Configure here.

@TalBarYakar TalBarYakar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

just change the commit message name so it will be clear what is being tested

…ption

A series key whose name equals an option keyword (ALIGN, COUNT, LATEST,
AGGREGATION, FILTER_BY_VALUE, FILTER_BY_TS) used to be matched as that option
in single-key TS.RANGE/TS.REVRANGE, with the next token consumed as the
option's value -- e.g. a key named 'align' matched ALIGN and ate the
fromTimestamp as the alignment value. PR #2052 (MOD-15893) scoped option
parsing past the key to fix it.

This test asserts a series keyed by an option keyword returns exactly what an
identically populated control series returns, across TS.RANGE/TS.REVRANGE and
the affected options, plus explicit post-fix values for the 'align'-named key
(the scenario the Jedis #align test hit).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@gabsow
gabsow force-pushed the tom.gabsow/MOD-15893-range-keyword-key-regression-test branch from 89c6757 to ef70245 Compare June 17, 2026 08:39
@gabsow gabsow changed the title test: regression guard for option-keyword-named keys in TS.RANGE (MOD-15893) test: series key named like an option keyword is not parsed as that option in TS.RANGE (MOD-15893) Jun 17, 2026
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.18%. Comparing base (fe20cd7) to head (0407498).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2069   +/-   ##
=======================================
  Coverage   70.18%   70.18%           
=======================================
  Files          41       41           
  Lines        8619     8619           
=======================================
  Hits         6049     6049           
  Misses       2570     2570           
Flag Coverage Δ
flow 70.18% <ø> (ø)

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

☔ View full report in Codecov by Harness.
📢 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.

@sonarqubecloud

sonarqubecloud Bot commented Nov 2, 2026

Copy link
Copy Markdown

@gabsow
gabsow merged commit fe0f602 into master Nov 2, 2026
45 checks passed
@gabsow
gabsow deleted the tom.gabsow/MOD-15893-range-keyword-key-regression-test branch November 2, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants