Skip to content

tests: fix unit-test SegmentReadTaskTest.InitInputStream#9867

Merged
ti-chi-bot[bot] merged 3 commits intopingcap:masterfrom
JinheLin:fix_ut
Feb 12, 2025
Merged

tests: fix unit-test SegmentReadTaskTest.InitInputStream#9867
ti-chi-bot[bot] merged 3 commits intopingcap:masterfrom
JinheLin:fix_ut

Conversation

@JinheLin
Copy link
Contributor

@JinheLin JinheLin commented Feb 12, 2025

What problem does this PR solve?

Issue Number: close #9866

Problem summary:

task->initInputStream(column_defines, 0, nullptr, ReadMode::Bitmap, DEFAULT_BLOCK_SIZE, true);
auto stream = task->getInputStream();
ASSERT_NE(stream, nullptr);
std::vector<Block> blks;
for (auto blk = stream->read(); blk; blk = stream->read())
{
blks.push_back(blk);
}
auto handle_col1 = vstackBlocks(std::move(blks)).getByName(MutSup::extra_handle_column_name).column;
auto handle_col2 = getSegmentHandle(task->segment->segmentId(), {task->segment->getRowKeyRange()});
ASSERT_TRUE(sequenceEqual(
toColumnVectorDataPtr<Int64>(handle_col2)->data(),
toColumnVectorDataPtr<Int64>(handle_col1)->data(),
handle_col1->size()));

  • In L124, used 0 as the parameter for start_ts, resulting in an empty read result.
  • In L134~L137, sequenceEqual not checking the size of the two sequences. Since handle_col1->size() is 0, this is equivalent to skipping the check of two sequences.

What is changed and how it works?

  • This PR fixes the issue of start_ts parameter.
  • Enhancement of sequenceEqual will be updated in another PR since modifying this function will affect other tests.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 12, 2025
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Feb 12, 2025
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 12, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Feb 12, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-02-12 06:08:42.194263248 +0000 UTC m=+423164.590485302: ☑️ agreed by Lloyd-Pottiger.
  • 2025-02-12 07:01:26.690551388 +0000 UTC m=+426329.086773450: ☑️ agreed by JaySon-Huang.

Copy link
Member

@CalvinNeo CalvinNeo left a comment

Choose a reason for hiding this comment

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

lgtm

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Feb 12, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CalvinNeo, JaySon-Huang, Lloyd-Pottiger

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

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [CalvinNeo,JaySon-Huang,Lloyd-Pottiger]

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

@ti-chi-bot ti-chi-bot bot merged commit 7e92c45 into pingcap:master Feb 12, 2025
5 checks passed
JaySon-Huang added a commit to JaySon-Huang/tiflash that referenced this pull request Jul 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UnitTest SegmentReadTaskTest.InitInputStream does not meet expectations

4 participants