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

Fix test allocated processors test #55429

Conversation

jasontedor
Copy link
Member

This test tries to set the number of allocated processors to seven. That is fine, unless the test is running on a machine where Runtime#availableProcessors is less than seven (typically when there are fewer than seven logical cores, but it can happen in various other ways related to CPU quotas in Docker containers with Docker-aware JVMs, etc.). This commit addresses this by randomizing the number of allocated processors, to a value that is less than or equal to the hard constraint on the number of allocated processors.

Relates #44894

This test tries to set the number of allocated processors to seven. That
is fine, unless the test is running on a machine where
Runtime#availableProcessors is less than seven (typically when there are
fewer than seven logical cores, but it can happen in various other ways
related to CPU quotas in Docker containers with Docker-aware JVMs,
etc.). This commit addresses this by randomizing the number of allocated
processors, to a value that is less than or equal to the hard constraint
on the number of allocated processors.
@jasontedor jasontedor added >test Issues or PRs that are addressing/adding tests :Core/Infra/Core Core issues without another label v8.0.0 labels Apr 18, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Core)

Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

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

LGTM

@jasontedor jasontedor merged commit 3c3ea41 into elastic:master Apr 18, 2020
@jasontedor jasontedor deleted the cluster-stats-it-test-allocated-processors branch April 18, 2020 20:24
@jasontedor
Copy link
Member Author

Thanks @dnhatn!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label >test Issues or PRs that are addressing/adding tests v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants