tidb
tidb copied to clipboard
test: add unique check for mock backend ctx
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
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.
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: |
/retest
@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.
[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
- ~~pkg/ddl/OWNERS~~ [ywqzzy]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
[LGTM Timeline notifier]
Timeline:
/retest
@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.
/retest
@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.
@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.
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.
@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.