-
Notifications
You must be signed in to change notification settings - Fork 721
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
tools/ut: add a parallel parameter #8186
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8186 +/- ##
==========================================
- Coverage 77.35% 77.32% -0.04%
==========================================
Files 471 471
Lines 61436 61436
==========================================
- Hits 47522 47503 -19
- Misses 10347 10360 +13
- Partials 3567 3573 +6
Flags with carried forward coverage won't be shown. Click here to find out more. |
Signed-off-by: husharp <[email protected]>
@@ -694,7 +701,8 @@ func buildTestBinaryMulti(pkgs []string) error { | |||
packages = append(packages, path.Join(modulePath, pkg)) | |||
} | |||
|
|||
p := strconv.Itoa(buildParallel) | |||
// We use 2 * parallel for `go build` to make it faster. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question, why do we choose 2 * parallel
to execute go build
? not 1.5 or 3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
background:
When building the test binaries, by default it is the number of cores(pkg.go.dev/cmd/go#hdr-Compile_packages_and_dependencies):
-p n
the number of programs, such as build commands or
test binaries, that can be run in parallel.
The default is GOMAXPROCS, normally the number of CPUs available.
When running the 'building binaries stage' of make ut, the CPU usage is not high with the default value. So I think it's a better idea to increase the parallelism.
why do we choose 2 * parallel to execute go build? not 1.5 or 3.
Choice 2 wasn't much thought or testing, and I think 2 is fine for the time being :) Or do you have any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or do you have any ideas?
I have no idea about that. I thought 2 had any special meaning before
parallel = runtime.GOMAXPROCS(0) | ||
} else { | ||
var err error | ||
parallel, err = strconv.Atoi(parallelStr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need check if the parallel<=runtime.GOMAXPROCS(0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need, we can support parallel greater than procs. It depends on the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to set a maximum value. For example, 1000. I just said it casually
what do you think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sense, and add a hint when parallel was set greater than procs :)
f42fc5e#diff-d1de7e6511458d33a769c0c501ec0ea45494dd9d2e830dc315e8fe623eb34b76R132
Signed-off-by: husharp <[email protected]>
@okJiang: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments. In response to this: 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. |
/merge |
@HuSharp: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger
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. |
This pull request has been accepted and is ready to merge. Commit hash: 3c5957c
|
ref tikv#7969 add parallel parameter Signed-off-by: husharp <[email protected]> Signed-off-by: okJiang <[email protected]>
ref tikv#7969 add parallel parameter Signed-off-by: husharp <[email protected]> Signed-off-by: okJiang <[email protected]>
What problem does this PR solve?
can execute
Issue Number: Ref #7969
What is changed and how does it work?
Check List
Tests
Release note