-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Add force single data path option for integ tests #71868
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
Add force single data path option for integ tests #71868
Conversation
Some functionality will no longer work with multiple data paths and in order to run integration tests for that, we need the capability to force a single data path for those tests. Relates elastic#71844
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Pinging @elastic/es-delivery (Team:Delivery) |
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.
I left a suggestion on how I think we can improve the clarity of the statement question (which, to be clear, was starting from a place of have opportunities for improvement), no need for another round.
@@ -350,7 +352,7 @@ public InternalTestCluster( | |||
numSharedDedicatedMasterNodes, numSharedDataNodes, numSharedCoordOnlyNodes, | |||
autoManageMasterNodes ? "auto-managed" : "manual"); | |||
this.nodeConfigurationSource = nodeConfigurationSource; | |||
numDataPaths = random.nextInt(5) == 0 ? 2 + random.nextInt(3) : 1; | |||
numDataPaths = forceSingleDataPath == false && random.nextInt(5) == 0 ? 2 + random.nextInt(3) : 1; |
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.
Could we rewrite this slightly so it’s clearer: I would want it to read “if forceSingleDataPath
is true then 1
else some random number of data paths” instead of the double negation right now. How about
// use 1 data path if we are forced to, or 80% of the time that we are not, otherwise use between 2 and 4 data paths
numDataPaths = forceSingleDataPath || random.nextInt(5) != 0 ? 1 : 2 + random.nextInt(3);
And maybe that random.nextInt(5) !=0
should be random.nextDouble() < 0.8
and then it’s even clearer?
// use 1 data path if we are forced to, or 80% of the time that we are not, otherwise use between 2 and 4 data paths
numDataPaths = forceSingleDataPath || random.nextDouble() < 0.8 ? 1 : 2 + random.nextInt(3);
And for one more iteration on clarity, how about randomIntBetween(2, 4
)?
// use 1 data path if we are forced to, or 80% of the time that we are not, otherwise use between 2 and 4 data paths
numDataPaths = forceSingleDataPath || random.nextDouble() < 0.8 ? 1 : randomIntBetween(2, 4);
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.
@elasticmachine update branch |
Some functionality will no longer work with multiple data paths and in order to run integration tests for that, we need the capability to force a single data path for those tests. Relates #71844
Some functionality will no longer work with multiple data paths and in
order to run integration tests for that, we need the capability to
force a single data path for those tests.
Relates #71844
Opt'ed for a method on
ESIntegTestCase
over adding to the annotation, since this felt less intrusive and MDP is going away anyway.