Skip to content

Add sorting test cases for range operations#21246

Open
nwnt wants to merge 1 commit intoetcd-io:mainfrom
nwnt:add-range-test-sorting
Open

Add sorting test cases for range operations#21246
nwnt wants to merge 1 commit intoetcd-io:mainfrom
nwnt:add-range-test-sorting

Conversation

@nwnt
Copy link
Member

@nwnt nwnt commented Feb 3, 2026

Breaking #21229 down. This PR adds the additional test cases, and groups the existing sorting and ordering ones so they stay close to each other.

cc @serathius

@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.45%. Comparing base (7c22682) to head (d7a0909).

Additional details and impacted files

see 21 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #21246      +/-   ##
==========================================
+ Coverage   68.43%   68.45%   +0.01%     
==========================================
  Files         429      429              
  Lines       35291    35291              
==========================================
+ Hits        24153    24160       +7     
+ Misses       9748     9742       -6     
+ Partials     1390     1389       -1     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7c22682...d7a0909. Read the comment docs.

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

@nwnt nwnt force-pushed the add-range-test-sorting branch from 6c679d9 to fc05e86 Compare February 4, 2026 14:30
Copy link
Member

@serathius serathius left a comment

Choose a reason for hiding this comment

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

Too early

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: nwnt
Once this PR has been reviewed and has the lgtm label, please assign fuweid for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

{name: "all KVs sorted by key descending", begin: "", options: config.GetOptions{Prefix: true, SortBy: clientv3.SortByKey, Order: clientv3.SortDescend}, wantResponse: &clientv3.GetResponse{Header: createHeader(firstHeader, 7), Count: 6, Kvs: reversedKvs}},
{name: "all KVs sorted by create rev", begin: "", options: config.GetOptions{Prefix: true, SortBy: clientv3.SortByCreateRevision}, wantResponse: &clientv3.GetResponse{Header: createHeader(firstHeader, 7), Count: 6, Kvs: allKvs}},
{name: "all KVs sorted by create rev desc", begin: "", options: config.GetOptions{Prefix: true, SortBy: clientv3.SortByCreateRevision, Order: clientv3.SortDescend}, wantResponse: &clientv3.GetResponse{Header: createHeader(firstHeader, 7), Count: 6, Kvs: reversedKvs}},
{name: "all KVs sorted by mod rev", begin: "", options: config.GetOptions{Prefix: true, SortBy: clientv3.SortByModRevision}, wantResponse: &clientv3.GetResponse{Header: createHeader(firstHeader, 7), Count: 6, Kvs: allKvs}},
Copy link
Member

@serathius serathius Feb 4, 2026

Choose a reason for hiding this comment

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

What's the benefit of testing sorting by modRev if the result is the same as sorting by create rev and key?

Copy link
Member Author

Choose a reason for hiding this comment

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

There are scenarios that they won't be I believe. However, to differentiate that I'll have to modify the data, which would make this PR ballooned and harder to understand.

What I can do is either:

  • Leave as is and I'll have a follow up PR to adjust the data to differentiate the scenario for mod rev.
  • Remove them for now and add them back later with that PR.

What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

I would not merge noop tests for the risk for forgetting and people assuming things are properly tested. If we want to split PR we should first improve the input data.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, removed the mod rev cases for now. Will have 2 follow-up PRs: one for the data rearrangement, the second is to add the cases.

Signed-off-by: Nont <nont@duck.com>
@nwnt nwnt force-pushed the add-range-test-sorting branch from fc05e86 to d7a0909 Compare February 4, 2026 16:22
@nwnt
Copy link
Member Author

nwnt commented Feb 4, 2026

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants