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

test: make several slow package unit test support run parallel #13431

Merged
merged 3 commits into from Nov 14, 2019

Conversation

glorv
Copy link
Contributor

@glorv glorv commented Nov 13, 2019

What problem does this PR solve?

make several package unit test support run unit test parallel to speed up unit test running

What is changed and how it works?

some unit test need to change global variables to set up running environment, thus make it impossible to run in parallel. By move these test into independent test suite and use SerialSuites instead of Suite, we can make sure they will still run in serial, so it will be safe to open the parallel flag for other tests.

Here is the result:
Before change:

>  go test -v -vet=off -p 10 -race github.com/pingcap/tidb/planner/core
ok  	github.com/pingcap/tidb/planner/core	110.140s

> go test -v -vet=off -p 10 -race github.com/pingcap/tidb/session
ok  	github.com/pingcap/tidb/session	123.002s

After change:

> go test -v -vet=off -p 10 -race github.com/pingcap/tidb/planner/core -check.p=true
ok  	github.com/pingcap/tidb/planner/core	41.524s

> go test -v -vet=off -p 10 -race github.com/pingcap/tidb/session -check.p=true
ok  	github.com/pingcap/tidb/session	95.673s

Check List

Tests

  • unit tests

Code changes

Side effects

Related changes

@CLAassistant
Copy link

CLAassistant commented Nov 13, 2019

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ AilinKid
✅ sre-bot
❌ gaolei


gaolei seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sykp241095 sykp241095 changed the title make several slow package test support parallel test test: make several slow package test support parallel test Nov 13, 2019
@glorv glorv changed the title test: make several slow package test support parallel test test: make several slow package unit test support run parallel Nov 13, 2019
@AilinKid
Copy link
Contributor

/run-all-tests

@codecov
Copy link

codecov bot commented Nov 13, 2019

Codecov Report

Merging #13431 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #13431   +/-   ##
===========================================
  Coverage   80.1686%   80.1686%           
===========================================
  Files           471        471           
  Lines        114062     114062           
===========================================
  Hits          91442      91442           
  Misses        15465      15465           
  Partials       7155       7155

@tiancaiamao
Copy link
Contributor

/run-all-tests

Copy link
Contributor

@eurekaka eurekaka left a comment

Choose a reason for hiding this comment

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

LGTM

@eurekaka eurekaka added component/test status/LGT1 Indicates that a PR has LGTM 1. labels Nov 14, 2019
@tiancaiamao
Copy link
Contributor

LGTM

@tiancaiamao tiancaiamao added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Nov 14, 2019
@tiancaiamao
Copy link
Contributor

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 14, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Nov 14, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Nov 14, 2019

@glorv merge failed.

@glorv
Copy link
Contributor Author

glorv commented Nov 14, 2019

/run-all-tests

@glorv
Copy link
Contributor Author

glorv commented Nov 14, 2019

/run-integration-copr-test

@zz-jason zz-jason merged commit 2aa571b into pingcap:master Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/test 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.

None yet

7 participants