Build: Pick default test jvms for macOS#35789
Merged
nik9000 merged 2 commits intoelastic:masterfrom Nov 27, 2018
Merged
Conversation
In elastic#35259 we switched the default number of VMs to fork for unit tests to the number of physical CPU cores. But because we could only get an accurate count on machines with a normal `/proc` filesystem, macOS machine did not pick up the new default. Given that macOS is a huge portion of developer machines, we'd like to get the right default there. This does that. It also moves the default-finding process from happening once per testing task to happening once at startup. This seems like a good choice in general, but a very good choice for macOS because we have to run a command to list the count.
Collaborator
|
Pinging @elastic/es-core-infra |
alpar-t
reviewed
Nov 22, 2018
| project.rootProject.ext.inFipsJvm = inFipsJvm | ||
| project.rootProject.ext.gradleJavaVersion = JavaVersion.toVersion(gradleJavaVersion) | ||
| project.rootProject.ext.java9Home = "${-> findJavaHome("9")}" | ||
| project.rootProject.ext.defaultParallel = findDefaultParallel(project.rootProject) |
Contributor
There was a problem hiding this comment.
Why set it up as an extension property rather than just return it ?
I think we should wait for a use-case that needs it.
Member
Author
There was a problem hiding this comment.
I wanted to build it one time. I could keep it as a private variable to the plugin if you think that is more idiomatic.
Contributor
There was a problem hiding this comment.
That makes sense when invoking an external program. I'm fine with it as-is for now, especially since there is already a precedent thanks for explaining.
We should at some point build a custom extensions that provides this type of information instead of relying on property extensions.
alpar-t
approved these changes
Nov 26, 2018
nik9000
added a commit
that referenced
this pull request
Nov 27, 2018
In #35259 we switched the default number of VMs to fork for unit tests to the number of physical CPU cores. But because we could only get an accurate count on machines with a normal `/proc` filesystem, macOS machine did not pick up the new default. Given that macOS is a huge portion of developer machines, we'd like to get the right default there. This does that. It also moves the default-finding process from happening once per testing task to happening once at startup. This seems like a good choice in general, but a very good choice for macOS because we have to run a command to list the count.
Member
Author
matriv
added a commit
to matriv/elasticsearch
that referenced
this pull request
Nov 27, 2018
Remove trailing line feed from the output of the command to get the number of CPUs. Follow up to: elastic#35789
matriv
added a commit
that referenced
this pull request
Nov 27, 2018
Remove trailing line feed from the output of the command to get the number of CPUs. Follow up to: #35789
matriv
added a commit
that referenced
this pull request
Nov 27, 2018
Remove trailing line feed from the output of the command to get the number of CPUs. Follow up to: #35789
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In #35259 we switched the default number of VMs to fork for unit tests to
the number of physical CPU cores. But because we could only get an accurate
count on machines with a normal
/procfilesystem, macOS machine did notpick up the new default. Given that macOS is a huge portion of developer
machines, we'd like to get the right default there. This does that.
It also moves the default-finding process from happening once per testing
task to happening once at startup. This seems like a good choice in general,
but a very good choice for macOS because we have to run a command to list
the count.