tidb icon indicating copy to clipboard operation
tidb copied to clipboard

test: add unique check for mock backend ctx

Open tangenta opened this issue 1 year ago • 11 comments

What problem does this PR solve?

Issue Number: close #52874

Problem Summary:

[2024/04/26 11:00:14.826 +08:00] [INFO] [mock.go:211] ["mock writer write row"] [key=7480000000000000685f698000000000000002016475706c69636174ff6576616c75650000fd] [idxVal=007d017f001c038000000000000000016475706c69636174ff6576616c75650000fd80000100000002010000]
[2024/04/26 11:00:14.826 +08:00] [INFO] [mock.go:211] ["mock writer write row"] [key=7480000000000000685f698000000000000002016475706c69636174ff6576616c75650000fd] [idxVal=007d017f001c038000000000000001016475706c69636174ff6576616c75650000fd80000100000002010000]

During the backfill step, writing to the same key for unique index should report "key exists" error.

What changed and how does it work?

Add unique check for mock backend ctx.

Check List

Tests

  • [x] Unit test
  • [ ] Integration test
  • [ ] Manual test (add detailed scripts or steps below)
  • [ ] No need to test
    • [ ] I checked and no code files have been changed.

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

Please refer to Release Notes Language Style Guide to write a quality release note.

None

tangenta avatar Apr 26 '24 03:04 tangenta

Hi @tangenta. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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 kubernetes/test-infra repository.

tiprow[bot] avatar Apr 26 '24 03:04 tiprow[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 73.7606%. Comparing base (12b37d8) to head (0097560). Report is 875 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #52900        +/-   ##
================================================
+ Coverage   72.4680%   73.7606%   +1.2926%     
================================================
  Files          1491       1491                
  Lines        429029     430819      +1790     
================================================
+ Hits         310909     317775      +6866     
+ Misses        98884      93095      -5789     
- Partials      19236      19949       +713     
Flag Coverage Δ
integration 23.4842% <38.0952%> (?)
unit 71.2527% <100.0000%> (-0.1108%) :arrow_down:

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

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 50.1338% <ø> (+8.6902%) :arrow_up:

codecov[bot] avatar Apr 26 '24 03:04 codecov[bot]

/retest

tangenta avatar Apr 26 '24 05:04 tangenta

@tangenta: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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 kubernetes/test-infra repository.

tiprow[bot] avatar Apr 26 '24 05:04 tiprow[bot]

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance6716, ywqzzy

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

The pull request process is described here

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

ti-chi-bot[bot] avatar Apr 26 '24 07:04 ti-chi-bot[bot]

[LGTM Timeline notifier]

Timeline:

  • 2024-04-26 06:56:27.130074908 +0000 UTC m=+329743.869977820: :ballot_box_with_check: agreed by ywqzzy.
  • 2024-04-26 07:17:35.01496568 +0000 UTC m=+331011.754868594: :ballot_box_with_check: agreed by lance6716.

ti-chi-bot[bot] avatar Apr 26 '24 07:04 ti-chi-bot[bot]

/retest

lance6716 avatar Apr 29 '24 03:04 lance6716

@lance6716: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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 kubernetes/test-infra repository.

tiprow[bot] avatar Apr 29 '24 03:04 tiprow[bot]

/retest

tangenta avatar Apr 29 '24 06:04 tangenta

@tangenta: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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 kubernetes/test-infra repository.

tiprow[bot] avatar Apr 29 '24 06:04 tiprow[bot]

@tangenta: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
idc-jenkins-ci-tidb/check_dev_2 00975600169510ed1d1070252593fd36e4a849b1 link true /test check-dev2

Full PR test history. Your PR dashboard.

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 kubernetes/test-infra repository. I understand the commands that are listed here.

ti-chi-bot[bot] avatar May 10 '24 01:05 ti-chi-bot[bot]

PR needs rebase.

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 kubernetes/test-infra repository.

ti-chi-bot[bot] avatar Jul 05 '24 08:07 ti-chi-bot[bot]

@tangenta: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
idc-jenkins-ci-tidb/check_dev_2 00975600169510ed1d1070252593fd36e4a849b1 link true /test check-dev2
pull-br-integration-test 00975600169510ed1d1070252593fd36e4a849b1 link true /test pull-br-integration-test
pull-lightning-integration-test 00975600169510ed1d1070252593fd36e4a849b1 link true /test pull-lightning-integration-test

Full PR test history. Your PR dashboard.

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 kubernetes/test-infra repository. I understand the commands that are listed here.

ti-chi-bot[bot] avatar Sep 04 '24 05:09 ti-chi-bot[bot]