-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add the ability to run Rest integration tests with 1 allocated processor #89234
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
Conversation
With this change it should be possible to catch possible deadlocks that would surface when a node runs in a 1 CPU hosts or node.processors is configured to use just 1 processor when the ThreadPools are configured/
|
Pinging @elastic/es-distributed (Team:Distributed) |
|
I haven't set it up for Rest tests as the nodes are configured in gradle and we don't have access to the test random seed there. |
Could you do something like this?
|
DaveCTurner
left a comment
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.
LGTM
|
I discussed this with @mark-vieira offline and we decided to define a new CI job that would run all the tests using 1 processor a few times a day, the arguments in favour of that approach were:
As cons:
The idea is to change this PR and let the test code accept a new system property that would set Are there any objections to this @henningandersen @DaveCTurner? |
No, that also sounds good to me. |
I'd like to keep the randomness in |
mark-vieira
left a comment
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 comment that I'd like @breskeby to provide feedback on. Otherwise LGTM.
| } | ||
|
|
||
| protected void indexRandomDocs(String index, int numdocs) throws InterruptedException { | ||
| indexRandomDocs(index, numdocs, true); |
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.
Are these simply test fixes related to this change?
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.
Yes, that's correct
| builder.put( | ||
| EsExecutors.NODE_PROCESSORS_SETTING.getKey(), | ||
| 1 + random.nextInt(Math.min(4, Runtime.getRuntime().availableProcessors())) | ||
| RandomNumbers.randomIntBetween(random, 1, Runtime.getRuntime().availableProcessors()) |
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.
Ok, so looks like we were already doing this sort of thing for internal cluster tests.
| } | ||
|
|
||
| private boolean shouldConfigureTestClustersWithOneProcessor() { | ||
| return Boolean.parseBoolean(System.getProperty("tests.configure_test_clusters_with_one_processor", "false")); |
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.
@breskeby Can you confirm it's no longer necessary to use provider factory to get system properties to ensure things are config cache compliant?
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.
@mark-vieira yes its not required anymore with newer gradle versions
|
@elasticmachine update branch |
|
Thanks all! |
…lastic#89562) Ass a follow up to elastic#89234, we want to also include this system property in reproduction lines so that developers are actually enabling this setting when trying to reproduce these failures.
This commit adds a new system property
tests.configure_test_clusters_with_one_processorthat configures Rest integration tests to run with 1 processor, this should help finding possible
deadlocks (if any) when the Elasticsearch nodes have
node.processorsset to 1.