Add the ability to run Rest integration tests with 1 allocated processor#89234
Add the ability to run Rest integration tests with 1 allocated processor#89234fcofdez merged 7 commits intoelastic:mainfrom
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? |
|
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.
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.
Are these simply test fixes related to this change?
There was a problem hiding this comment.
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.
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.
@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.
@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.