Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storage: Introduce test framework similar to Segment Test for DMStore #5982

Merged
merged 17 commits into from
Sep 22, 2022

Conversation

breezewish
Copy link
Member

@breezewish breezewish commented Sep 21, 2022

What problem does this PR solve?

Issue Number: ref #5237

What is changed and how it works?

  1. A new test framework for DeltaMergeStore is introduced, in order to write tests for it easier. The usage is very similar to our Segment Test Framework, that mostly you only need to specify a Int64 PK for everything and you will get compatibility for both common handle and int handle.

    Example usages: https://github.com/pingcap/tiflash/blob/62dd77770790df636c7168f6bf482e55ce603d58/dbms/src/Storages/DeltaMerge/tests/gtest_dm_store_background.cpp

  2. Migrated the background test in the DeltaMergeStore into this new test framework.

  3. Always enable release build for libsymbolization, because I found it takes too much time (as long as 10+s) to generate a stack trace when libsymbolization is compiled under debug profile. Note that the stack trace is used in the SyncPoint framework -- it always prints the stack trace for easier debugging.

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
Copy link
Member

ti-chi-bot commented Sep 21, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JaySon-Huang
  • flowbehappy

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 21, 2022
@breezewish
Copy link
Member Author

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Sep 22, 2022

Coverage for changed files

Filename                              Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
gtest_dm_delta_merge_store.cpp            908               335    63.11%          68                 1    98.53%        2822                69    97.55%         264               183    30.68%
gtest_dm_simple_pk_test_basic.cpp         121                34    71.90%          18                 2    88.89%         223                17    92.38%          42                19    54.76%
gtest_dm_simple_pk_test_basic.h             2                 0   100.00%           2                 0   100.00%           6                 0   100.00%           0                 0         -
gtest_dm_store_background.cpp              61                28    54.10%           8                 0   100.00%          92                 0   100.00%          16                16     0.00%
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                    1092               397    63.64%          96                 3    96.88%        3143                86    97.26%         322               218    32.30%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18799      7990             57.50%    219142  82307        62.44%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 22, 2022
@flowbehappy flowbehappy self-requested a review September 22, 2022 13:39
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Sep 22, 2022
@flowbehappy
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

@flowbehappy: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 07bf54f

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 22, 2022
@breezewish
Copy link
Member Author

/run-unit-test

@sre-bot
Copy link
Collaborator

sre-bot commented Sep 22, 2022

Coverage for changed files

Filename                              Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
gtest_dm_delta_merge_store.cpp            908               335    63.11%          68                 1    98.53%        2822                69    97.55%         264               183    30.68%
gtest_dm_simple_pk_test_basic.cpp         121                34    71.90%          18                 2    88.89%         223                17    92.38%          42                19    54.76%
gtest_dm_simple_pk_test_basic.h             2                 0   100.00%           2                 0   100.00%           6                 0   100.00%           0                 0         -
gtest_dm_store_background.cpp              61                28    54.10%           8                 0   100.00%          92                 0   100.00%          16                16     0.00%
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                    1092               397    63.64%          96                 3    96.88%        3143                86    97.26%         322               218    32.30%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18278      7510             58.91%    213809  77125        63.93%

full coverage report (for internal network access only)

@breezewish breezewish merged commit f22873c into master Sep 22, 2022
@breezewish breezewish deleted the wenxuan/dm_test branch September 22, 2022 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants