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

*: let our unit test cover the infoschema v2 code #52156

Merged
merged 13 commits into from Apr 12, 2024

Conversation

tiancaiamao
Copy link
Contributor

What problem does this PR solve?

Issue Number: ref #50959

Problem Summary:

What changed and how does it work?

Most the code can pass under infoschema v2 now.
We need a way to run the new code in our CI to prevent regression.

I change the testkit initialize code to make it:

	if intest.InTest {
		if rand.Intn(10) > 3 { // 70% chance to run infoschema v2
			tk.MustExec("set @@global.tidb_schema_cache_size = 1024")
		}
	}

Fix cases:

[FAIL]  pkg/ddl/tests/fail TestPartitionAddIndexGC
[FAIL]  pkg/infoschema/test/infoschemav2test TestSpecialSchemas
[FAIL]  pkg/disttask/framework/integrationtests TestRoleBasic
[FAIL]  pkg/executor TestTikvRegionStatus
[FAIL]  pkg/infoschema TestBuildBundle

Some of those cases success to run if we set DefTiDBSchemaCacheSize, but fail if we set the @@global.tidb_schema_cache_size variable.

Check List

Tests

  • Unit test

Now the CI should cover the new code.

  • 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

@ti-chi-bot ti-chi-bot bot added release-note-none size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 27, 2024
Copy link

tiprow bot commented Mar 27, 2024

Hi @tiancaiamao. 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.

Copy link

codecov bot commented Mar 27, 2024

Codecov Report

Merging #52156 (7f664b5) into master (510f44f) will increase coverage by 1.0627%.
Report is 30 commits behind head on master.
The diff coverage is 100.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #52156        +/-   ##
================================================
+ Coverage   74.1313%   75.1940%   +1.0627%     
================================================
  Files          1467       1489        +22     
  Lines        354270     435036     +80766     
================================================
+ Hits         262625     327121     +64496     
- Misses        72418      87021     +14603     
- Partials      19227      20894      +1667     
Flag Coverage Δ
integration 51.7922% <33.3333%> (?)
unit 71.0182% <100.0000%> (-1.8612%) ⬇️

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

Components Coverage Δ
dumpling 53.9957% <ø> (-2.3014%) ⬇️
parser ∅ <ø> (∅)
br 61.5604% <ø> (+18.8960%) ⬆️

@tiancaiamao
Copy link
Contributor Author

/run-unit-test

@tiancaiamao
Copy link
Contributor Author

/test unit-test

Copy link

tiprow bot commented Mar 27, 2024

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

In response to this:

/test unit-test

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.

@tiancaiamao
Copy link
Contributor Author

/test check-dev2

Copy link

ti-chi-bot bot commented Mar 27, 2024

@tiancaiamao: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test build
  • /test check-dev
  • /test check-dev2
  • /test mysql-test
  • /test pull-br-integration-test
  • /test pull-integration-ddl-test
  • /test pull-lightning-integration-test
  • /test pull-mysql-client-test
  • /test unit-test

The following commands are available to trigger optional jobs:

  • /test canary-notify-when-compatibility-sections-changed
  • /test pingcap/tidb/canary_ghpr_unit_test
  • /test pull-common-test
  • /test pull-e2e-test
  • /test pull-integration-common-test
  • /test pull-integration-copr-test
  • /test pull-integration-jdbc-test
  • /test pull-integration-mysql-test
  • /test pull-integration-nodejs-test
  • /test pull-sqllogic-test
  • /test pull-tiflash-test

Use /test all to run the following jobs that were automatically triggered:

  • pingcap/tidb/ghpr_build
  • pingcap/tidb/ghpr_check
  • pingcap/tidb/ghpr_check2
  • pingcap/tidb/ghpr_mysql_test
  • pingcap/tidb/ghpr_unit_test
  • pingcap/tidb/pull_integration_ddl_test
  • pingcap/tidb/pull_mysql_client_test

In response to this:

/test check-dev2

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.

Copy link

tiprow bot commented Mar 27, 2024

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

In response to this:

/test check-dev2

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.

@tiancaiamao
Copy link
Contributor Author

/test check-dev2

Copy link

tiprow bot commented Mar 28, 2024

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

In response to this:

/test check-dev2

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.

@ywqzzy ywqzzy self-requested a review March 28, 2024 02:42
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 28, 2024
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 28, 2024
@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 8, 2024
Copy link

ti-chi-bot bot commented Apr 8, 2024

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 ti-chi-bot bot added sig/planner SIG: Planner and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 9, 2024
Copy link
Contributor

@GMHDBJD GMHDBJD left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

ti-chi-bot bot commented Apr 11, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-04-09 07:04:39.724965691 +0000 UTC m=+945941.252506236: ☑️ agreed by ywqzzy.
  • 2024-04-11 11:29:09.627636692 +0000 UTC m=+1134611.155177238: ☑️ agreed by GMHDBJD.

@@ -124,6 +124,10 @@ func TestTooLongBinaryPlan(t *testing.T) {
require.NoError(t, logutil.InitLogger(newCfg.Log.ToLogConfig()))
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
if tk.MustQuery("select @@tidb_schema_cache_size > 0").Equal(testkit.Rows("1")) {
t.Skip("TODO: the performance is poor for this test under infoschema v2")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

#52479 optimize the performance here, after that we do not need to skip.

@easonn7
Copy link

easonn7 commented Apr 12, 2024

/approve

Copy link

ti-chi-bot bot commented Apr 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: easonn7, GMHDBJD, time-and-fate, 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 ti-chi-bot bot added the approved label Apr 12, 2024
@tiancaiamao
Copy link
Contributor Author

/test pull-br-integration-test

Copy link

tiprow bot commented Apr 12, 2024

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

In response to this:

/test pull-br-integration-test

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 ti-chi-bot bot merged commit 5954be7 into pingcap:master Apr 12, 2024
25 checks passed
@tiancaiamao tiancaiamao deleted the v2-ci branch April 12, 2024 10:07
3AceShowHand pushed a commit to 3AceShowHand/tidb that referenced this pull request Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants