Skip to content

Build: Pick default test jvms for macOS#35789

Merged
nik9000 merged 2 commits intoelastic:masterfrom
nik9000:build_defaut_forks
Nov 27, 2018
Merged

Build: Pick default test jvms for macOS#35789
nik9000 merged 2 commits intoelastic:masterfrom
nik9000:build_defaut_forks

Conversation

@nik9000
Copy link
Copy Markdown
Member

@nik9000 nik9000 commented Nov 21, 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.

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.
@nik9000 nik9000 added :Delivery/Build Build or test infrastructure v7.0.0 v6.6.0 labels Nov 21, 2018
@nik9000 nik9000 requested a review from alpar-t November 21, 2018 14:32
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-infra

Copy link
Copy Markdown
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

LGTM

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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@nik9000 nik9000 merged commit 38725bd into elastic:master Nov 27, 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.
@nik9000
Copy link
Copy Markdown
Member Author

nik9000 commented Nov 27, 2018

Thanks for reviewing @rjernst and @atorok!

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
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Delivery/Build Build or test infrastructure >non-issue Team:Delivery Meta label for Delivery team v6.6.0 v7.0.0-beta1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants